From c486256e01997d23e8ef1d63516337ec68b4983e Mon Sep 17 00:00:00 2001 From: terminx Date: Wed, 11 Feb 2015 05:22:35 +0000 Subject: [PATCH] Android fixes: let the player climb stairs while crouched and fix the quick switch function of the weapon wheel. DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@4994 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/player.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index a365d64e8..73e369db1 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -3095,6 +3095,7 @@ static void P_ChangeWeapon(DukePlayer_t *p, int32_t weapon) if (i != -2) p->curr_weapon = weapon; + p->random_club_frame = 0; if (p->weapon_pos == 0) @@ -3115,15 +3116,19 @@ static void P_ChangeWeapon(DukePlayer_t *p, int32_t weapon) if (p->holster_weapon) { -#ifdef __ANDROID__ - CONTROL_Android_SetLastWeapon(p->last_weapon); -#endif - p->weapon_pos = WEAPON_POS_RAISE; p->holster_weapon = 0; p->last_weapon = -1; } +#ifdef __ANDROID__ + if (curr_weapon != p->curr_weapon && +// p->last_weapon != -1 && + !(PWEAPON(snum, curr_weapon, WorksLike) == HANDREMOTE_WEAPON && PWEAPON(snum, p->curr_weapon, WorksLike) == HANDBOMB_WEAPON) && + !(PWEAPON(snum, curr_weapon, WorksLike) == HANDBOMB_WEAPON && PWEAPON(snum, p->curr_weapon, WorksLike) == HANDREMOTE_WEAPON)) + CONTROL_Android_SetLastWeapon(PWEAPON(snum, curr_weapon, WorksLike) == HANDREMOTE_WEAPON ? (int)HANDBOMB_WEAPON : curr_weapon); +#endif + p->kickback_pic = 0; P_SetWeaponGamevars(snum, p); @@ -4954,6 +4959,11 @@ HORIZONLY: if (psectlotag == ST_1_ABOVE_WATER || p->spritebridge == 1) i = p->autostep_sbw; else i = p->autostep; +#ifdef EDUKE32_TOUCH_DEVICES + if (TEST_SYNC_KEY(sb_snum, SK_CROUCH)) + i = p->autostep_sbw; +#endif + if (p->cursectnum >= 0 && sector[p->cursectnum].lotag == ST_2_UNDERWATER) k = 0; else k = 1;