From e4e1662ce6e1d44f1714a2776791f151334b5bde Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Sun, 13 Jul 2014 16:53:36 +0200 Subject: allow configurable teleporter ejection speed --- src/game/g_target.c | 4 +++- src/game/g_trigger.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/game') diff --git a/src/game/g_target.c b/src/game/g_target.c index 057decbb..2ff6ab27 100644 --- a/src/game/g_target.c +++ b/src/game/g_target.c @@ -211,7 +211,7 @@ void target_teleporter_use( gentity_t *self, gentity_t *other, gentity_t *activa return; } - TeleportPlayer( activator, dest->s.origin, dest->s.angles, 400.0f ); + TeleportPlayer( activator, dest->s.origin, dest->s.angles, self->speed ); } /*QUAKED target_teleporter (1 0 0) (-8 -8 -8) (8 8 8) @@ -222,6 +222,8 @@ void SP_target_teleporter( gentity_t *self ) if( !self->targetname ) G_Printf( "untargeted %s at %s\n", self->classname, vtos( self->s.origin ) ); + G_SpawnFloat( "speed", "400", &self->speed ); + self->use = target_teleporter_use; } diff --git a/src/game/g_trigger.c b/src/game/g_trigger.c index caed1d75..267bcad7 100644 --- a/src/game/g_trigger.c +++ b/src/game/g_trigger.c @@ -295,7 +295,7 @@ void trigger_teleporter_touch( gentity_t *self, gentity_t *other, trace_t *trace return; } - TeleportPlayer( other, dest->s.origin, dest->s.angles, 400.0f ); + TeleportPlayer( other, dest->s.origin, dest->s.angles, self->speed ); } /* @@ -321,6 +321,8 @@ void SP_trigger_teleport( gentity_t *self ) { InitTrigger( self ); + G_SpawnFloat( "speed", "400", &self->speed ); + // unlike other triggers, we need to send this one to the client // unless is a spectator trigger if( self->spawnflags & 1 ) -- cgit