summaryrefslogtreecommitdiff
path: root/src/game/g_trigger.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2006-06-17 22:50:56 +0000
committerTim Angus <tim@ngus.net>2006-06-17 22:50:56 +0000
commitda11bfa115f0670861cb18e05ec45ba515b7c3b7 (patch)
treed59e131b0c190ea6e37303195024874398ad93e2 /src/game/g_trigger.c
parente3fc2fe0d9b43f2ed52586f0b838756a8f57fa8e (diff)
* Added some value guards to various trigger entities
Diffstat (limited to 'src/game/g_trigger.c')
-rw-r--r--src/game/g_trigger.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/game/g_trigger.c b/src/game/g_trigger.c
index a9ecd1a3..f9472e0e 100644
--- a/src/game/g_trigger.c
+++ b/src/game/g_trigger.c
@@ -420,7 +420,7 @@ void SP_trigger_hurt( gentity_t *self )
self->noise_index = G_SoundIndex( "sound/misc/electro.wav" );
self->touch = hurt_touch;
- if( !self->damage )
+ if( self->damage <= 0 )
self->damage = 5;
self->r.contents = CONTENTS_TRIGGER;
@@ -1067,6 +1067,12 @@ void SP_trigger_heal( gentity_t *self )
{
G_SpawnInt( "heal", "5", &self->damage );
+ if( self->damage <= 0 )
+ {
+ self->damage = 1;
+ G_Printf( S_COLOR_YELLOW "WARNING: trigger_heal with negative damage key\n" );
+ }
+
self->touch = trigger_heal_touch;
self->use = trigger_heal_use;
@@ -1140,6 +1146,12 @@ void SP_trigger_ammo( gentity_t *self )
{
G_SpawnInt( "ammo", "1", &self->damage );
+ if( self->damage <= 0 )
+ {
+ self->damage = 1;
+ G_Printf( S_COLOR_YELLOW "WARNING: trigger_ammo with negative ammo key\n" );
+ }
+
self->touch = trigger_ammo_touch;
InitTrigger( self );