From 48ef16f292a353681b6fee50363a402a069285b3 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Tue, 7 Aug 2007 16:56:31 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1210 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/weapon.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index e71b8de5..1d443d55 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -33,6 +33,8 @@ void checkweaponswitch() { gun_changed = true; player1->weaponchanging = false; + if(player1->gunwait) player1->gunwait = max(player1->gunwait - (lastmillis-player1->lastaction), 0); + player1->lastaction = player1->gunwait ? lastmillis : 0; } else if(timeprogress>WEAPONCHANGE_TIME/2) { @@ -118,10 +120,11 @@ void reload(playerent *d) if(d->mag[d->gunselect] >= (has_akimbo(d) ? 2 : 1)*guns[d->gunselect].magsize) return; if(d == player1) setscope(false); + if(player1->gunwait) player1->gunwait = max(player1->gunwait - (lastmillis-player1->lastaction), 0); d->reloading = true; d->lastaction = lastmillis; d->akimbolastaction[0] = d->akimbolastaction[1] = lastmillis; - d->gunwait = guns[d->gunselect].reloadtime; + d->gunwait += guns[d->gunselect].reloadtime; int numbullets = (has_akimbo(d) ? 2 : 1)*guns[d->gunselect].magsize - d->mag[d->gunselect];