summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2014-07-13 16:53:36 +0200
committer/dev/humancontroller <devhc@example.com>2017-03-09 13:51:10 +0100
commite4e1662ce6e1d44f1714a2776791f151334b5bde (patch)
treebd24d9e003688bff8923351261def4605146765f
parenta284f3aa74fa543ad6384f56779d55a8d96d6a51 (diff)
allow configurable teleporter ejection speed
-rw-r--r--src/game/g_target.c4
-rw-r--r--src/game/g_trigger.c4
2 files changed, 6 insertions, 2 deletions
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 )