summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2006-01-12 17:05:09 +0000
committerTim Angus <tim@ngus.net>2006-01-12 17:05:09 +0000
commit7436505136de3c6b2034d80c53843ce214b82286 (patch)
tree3f2be71c8010460aa6920960cf35ab24b776285e /src/game
parentce70dcdb3f657f8fa1cf48ca9ba9a6074f40c3f5 (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.c15
-rw-r--r--src/game/bg_public.h2
-rw-r--r--src/game/tremulous.h1
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