From 968bbcca96e2800894e017bc43a39194925e088a Mon Sep 17 00:00:00 2001 From: driAn Date: Mon, 11 Feb 2008 15:16:49 +0000 Subject: [PATCH] flag dropping on heighfields, fixed menu hotkeys git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1641 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/entities.cpp | 15 +++++++++++---- source/src/menus.cpp | 9 +++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/source/src/entities.cpp b/source/src/entities.cpp index e0676632..7c12e8ad 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -310,10 +310,17 @@ void flagstolen(int flag, int action, int act) void flagdropped(int flag, int action, short x, short y, short z) { flaginfo &f = flaginfos[flag]; - if(OUTBORD(x, y)) return; - f.flag->x = x; - f.flag->y = y; - f.flag->z = (short)floor(x, y); + if(OUTBORD(x, y)) return; // valid pos + bounceent p; + p.rotspeed = 0.0f; + p.o.x = x; + p.o.y = y; + p.o.z = (short)floor(x, y); + p.vel.z = -1.0f; + loopi(50) moveplayer(&p, 50, true); + f.flag->x = p.o.x; + f.flag->y = p.o.y; + f.flag->z = p.o.z; if(f.flag->z < hdr.waterlevel) f.flag->z = (short) hdr.waterlevel; f.flag->spawned = true; f.ack = true; diff --git a/source/src/menus.cpp b/source/src/menus.cpp index 42b2d522..054f05fb 100644 --- a/source/src/menus.cpp +++ b/source/src/menus.cpp @@ -572,8 +572,13 @@ bool menukey(int code, bool isdown, int unicode) case SDLK_9: if(curmenu->allowinput && curmenu->hotkeys) { - mitem &m = *curmenu->items[code-SDLK_1]; - m.select(); + int idx = code-SDLK_1; + if(curmenu->items.inrange(idx)) + { + menuselect(curmenu, idx); + mitem &m = *curmenu->items[idx]; + m.select(); + } return true; } default: