diff options
author | Tim Angus <tim@ngus.net> | 2006-06-04 22:17:32 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2006-06-04 22:17:32 +0000 |
commit | 409e6051a48221cb2a02c182dc0d5e64f2eeb40f (patch) | |
tree | bc21ff57ac201d2e7316a23aabb7aeb24902d2de /src/game/g_target.c | |
parent | db12d262430a58bae27e2b1ece3f07215a1083d2 (diff) |
* Added target_hurt
* Various other map entity fixes/enhancements
* Hovel exploit fixed
* Fixed tesla trail disappearing at edge of range
* Default player name now inherited from OS
* Fixed spelling of Veda's surname :x
Diffstat (limited to 'src/game/g_target.c')
-rw-r--r-- | src/game/g_target.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/game/g_target.c b/src/game/g_target.c index 1a32ce77..dfb9c7e2 100644 --- a/src/game/g_target.c +++ b/src/game/g_target.c @@ -437,3 +437,36 @@ void SP_target_human_win( gentity_t *self ) { self->use = target_human_win_use; } + +/* +=============== +target_hurt_use +=============== +*/ +void target_hurt_use( gentity_t *self, gentity_t *other, gentity_t *activator ) +{ + // hurt the activator + if( !activator->takedamage ) + return; + + G_Damage( activator, self, self, NULL, NULL, self->damage, 0, MOD_TRIGGER_HURT ); +} + +/* +=============== +SP_target_hurt +=============== +*/ +void SP_target_hurt( gentity_t *self ) +{ + if( !self->targetname ) + { + G_Printf( S_COLOR_YELLOW "WARNING: untargeted %s at %s\n", self->classname, + vtos( self->s.origin ) ); + } + + if( !self->damage ) + self->damage = 5; + + self->use = target_hurt_use; +} |