From 1efd1b0d948642abda146d33f615e33a31c35fc8 Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Wed, 27 Mar 2002 17:20:38 +0000 Subject: [PATCH] Workaround to the bandage bug :) --- reaction/game/bg_pmove.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/reaction/game/bg_pmove.c b/reaction/game/bg_pmove.c index ee7f0c01..a9ed3bca 100644 --- a/reaction/game/bg_pmove.c +++ b/reaction/game/bg_pmove.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.64 2002/03/27 17:20:38 jbravo +// Workaround to the bandage bug :) +// // Revision 1.63 2002/03/23 05:17:42 jbravo // Major cleanup of game -> cgame communication with LCA vars. // @@ -1961,16 +1964,25 @@ PM_FinishWeaponChange =============== */ static void PM_FinishWeaponChange( void ) { - int weapon; + int weapon, savedWeap; weapon = pm->cmd.weapon; +// JBravo: debug for the bandage bug + savedWeap = pm->ps->weapon; + if ( weapon < WP_NONE || weapon >= WP_NUM_WEAPONS ) { - weapon = WP_NONE; + Com_Printf("BANDAGEBUG: (1) weapon is %d and cmd.weapon is %d. Reverting to previous weapon\n", pm->ps->weapon, + weapon); + weapon = savedWeap; +// weapon = WP_NONE; } if ( !( pm->ps->stats[STAT_WEAPONS] & ( 1 << weapon ) ) ) { - weapon = WP_NONE; + Com_Printf("BANDAGEBUG: (2) weapon is %d and cmd.weapon is %d. Reverting to previous weapon\n", pm->ps->weapon, + weapon); + weapon = savedWeap; +// weapon = WP_NONE; } //Remove grenade/knife if out of ammo