diff options
author | Tim Angus <tim@ngus.net> | 2006-01-12 17:05:09 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2006-01-12 17:05:09 +0000 |
commit | 7436505136de3c6b2034d80c53843ce214b82286 (patch) | |
tree | 3f2be71c8010460aa6920960cf35ab24b776285e /src/game | |
parent | ce70dcdb3f657f8fa1cf48ca9ba9a6074f40c3f5 (diff) |
* Fixed lcannon charge storage exploit
* Fixed psaw/cgun inappropriate effects bug
* Lcannon now has a minimum charge value
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_pmove.c | 15 | ||||
-rw-r--r-- | src/game/bg_public.h | 2 | ||||
-rw-r--r-- | src/game/tremulous.h | 1 |
3 files changed, 17 insertions, 1 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 107d7929..a2a9f543 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -2601,6 +2601,10 @@ static void PM_BeginWeaponChange( int weapon ) if( pm->ps->weaponstate == WEAPON_DROPPING ) return; + //special case to prevent storing a charged up lcannon + 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; @@ -2865,8 +2869,15 @@ static void PM_Weapon( void ) } //erp this looks confusing - if( pm->ps->stats[ STAT_MISC ] > 0 ) + if( pm->ps->stats[ STAT_MISC ] > LCANNON_MIN_CHARGE ) attack1 = !attack1; + else if( pm->ps->stats[ STAT_MISC ] > 0 ) + { + pm->ps->stats[ STAT_MISC ] = 0; + pm->ps->weaponTime = 0; + pm->ps->weaponstate = WEAPON_READY; + return; + } break; default: @@ -2905,6 +2916,7 @@ static void PM_Weapon( void ) { pm->ps->weaponTime = 0; pm->ps->weaponstate = WEAPON_READY; + pm->ps->generic1 = WPM_NOTFIRING; return; } } @@ -2920,6 +2932,7 @@ static void PM_Weapon( void ) { pm->ps->weaponTime = 0; pm->ps->weaponstate = WEAPON_READY; + pm->ps->generic1 = WPM_NOTFIRING; return; } } diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 6bcb0d4e..2fccdda8 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -331,6 +331,8 @@ typedef enum WPM_SECONDARY, WPM_TERTIARY, + WPM_NOTFIRING, + WPM_NUM_WEAPONMODES } weaponMode_t; diff --git a/src/game/tremulous.h b/src/game/tremulous.h index 8508a1e4..79eb67d5 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -408,6 +408,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define LCANNON_SPEED 350 #define LCANNON_CHARGE_TIME 2000 #define LCANNON_TOTAL_CHARGE 255 +#define LCANNON_MIN_CHARGE 50 #define HBUILD_PRICE 0 #define HBUILD_REPEAT 1000 |