summaryrefslogtreecommitdiff
path: root/src/game/bg_pmove.c
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2017-04-13 11:30:00 +0000
committer/dev/humancontroller <devhc@example.com>2017-04-15 17:24:17 +0200
commit8cf1bba6ff535d76377b9cbb891d2ff1798648ab (patch)
treeedc5a6627e45e74449c4608c322166572c3e9d03 /src/game/bg_pmove.c
parent96aae565da71018d0273a2ba5ade60c95d30141b (diff)
port bugfixes related to weapon reloading from the modern codebase
- fix the continuous blaster re-reraising bug when the primary weapon is out of ammo - fix the reload requests sticking until a reloadable weapon is raised - immediately interrupt a reload process when switching
Diffstat (limited to 'src/game/bg_pmove.c')
-rw-r--r--src/game/bg_pmove.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index 73ee6d9..c54fba0 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -2618,6 +2618,10 @@ static void PM_BeginWeaponChange( int weapon )
if( pm->ps->weapon == WP_LUCIFER_CANNON )
pm->ps->stats[ STAT_MISC ] = 0;
+ // cancel a reload
+ pm->ps->pm_flags &= ~PMF_WEAPON_RELOAD;
+ if( pm->ps->weaponstate == WEAPON_RELOADING )
+ pm->ps->weaponTime = 0;
// force this here to prevent flamer effect from continuing, among other issues
pm->ps->generic1 = WPM_NOTFIRING;
@@ -2836,7 +2840,8 @@ static void PM_Weapon( void )
}
// check for end of clip
- if( ( !ammo || pm->ps->pm_flags & PMF_WEAPON_RELOAD ) && clips )
+ if( !BG_FindInfinteAmmoForWeapon( pm->ps->weapon ) &&
+ ( !ammo || pm->ps->pm_flags & PMF_WEAPON_RELOAD ) && clips )
{
pm->ps->pm_flags &= ~PMF_WEAPON_RELOAD;