diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cgame/cg_draw.c | 2 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 13 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index b12174f2..144e6983 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -2049,7 +2049,7 @@ void CG_DrawWeaponIcon( rectDef_t *rect, vec4_t color ) cent = &cg_entities[ cg.snap->ps.clientNum ]; ps = &cg.snap->ps; - weapon = BG_GetPlayerWeapon( ps ); + weapon = ps->weapon; maxAmmo = BG_Weapon( weapon )->maxAmmo; diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index e49bf4c2..a8001ea9 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -2762,7 +2762,6 @@ static void PM_BeginWeaponChange( int weapon ) if( pm->ps->weapon == WP_LUCIFER_CANNON ) pm->ps->stats[ STAT_MISC ] = 0; - PM_AddEvent( EV_CHANGE_WEAPON ); pm->ps->weaponstate = WEAPON_DROPPING; pm->ps->weaponTime += 200; pm->ps->persistant[ PERS_NEWWEAPON ] = weapon; @@ -2787,6 +2786,7 @@ static void PM_FinishWeaponChange( void ) { int weapon; + PM_AddEvent( EV_CHANGE_WEAPON ); weapon = pm->ps->persistant[ PERS_NEWWEAPON ]; if( weapon < WP_NONE || weapon >= WP_NUM_WEAPONS ) weapon = WP_NONE; @@ -3023,7 +3023,16 @@ static void PM_Weapon( void ) if( pm->ps->pm_flags & PMF_WEAPON_SWITCH ) { pm->ps->pm_flags &= ~PMF_WEAPON_SWITCH; - PM_BeginWeaponChange( pm->ps->persistant[ PERS_NEWWEAPON ] ); + if( pm->ps->weapon != WP_NONE ) + { + // drop the current weapon + PM_BeginWeaponChange( pm->ps->persistant[ PERS_NEWWEAPON ] ); + } + else + { + // no current weapon, so just raise the new one + PM_FinishWeaponChange( ); + } } } |