From 9ab6ab7139a394d6be34408f70c8412de7909dc6 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 11 Jan 2015 04:51:17 +0000 Subject: [PATCH] Fix up weapon switching deficiencies git-svn-id: https://svn.eduke32.com/eduke32@4888 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/player.c | 2 ++ polymer/eduke32/source/sector.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index ddafa8231..55ffc2b39 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -3101,6 +3101,8 @@ static void P_ChangeWeapon(DukePlayer_t *p, int32_t weapon) if (p->weapon_pos == 0) p->weapon_pos = -1; + else if ((unsigned)p->weapon_pos < WEAPON_POS_RAISE) + p->weapon_pos = -p->weapon_pos; else p->weapon_pos = WEAPON_POS_LOWER; if (p->holster_weapon) diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index d58337f2a..667e2aec9 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -2644,8 +2644,9 @@ CHECKINV1: p->kickback_pic = 0; } - if ((int32_t)j != -1 && p->last_pissed_time <= (GAMETICSPERSEC*218) && p->show_empty_weapon == 0 /*&& p->kickback_pic == 0*/ && - p->quick_kick == 0 && sprite[p->i].xrepeat > 32 && p->access_incs == 0 && p->knee_incs == 0) + if ((int32_t)j != -1 && p->last_pissed_time <= (GAMETICSPERSEC * 218) && p->show_empty_weapon == 0 && + p->kickback_pic == 0 && p->quick_kick == 0 && sprite[p->i].xrepeat > 32 && p->access_incs == 0 && + p->knee_incs == 0) { // if( ( p->weapon_pos == 0 || ( p->holster_weapon && p->weapon_pos == WEAPON_POS_LOWER ) )) {