if(self.pushltime < time) // only show one teleport effect per teleporter per 0.2 seconds, for better fps
{
if(tflags & TELEPORT_FLAG_SOUND)
- sound (player, CH_TRIGGER, SND_TELEPORT, VOL_BASE, ATTEN_NORM);
+ {
+ string thesound = SND(TELEPORT);
+ if(teleporter.noise != "")
+ {
+ RandomSelection_Init();
+ FOREACH_WORD(teleporter.noise, true,
+ {
+ RandomSelection_Add(NULL, 0, it, 1, 1);
+ });
+ thesound = RandomSelection_chosen_string;
+ }
+ _sound (player, CH_TRIGGER, thesound, VOL_BASE, ATTEN_NORM);
+ }
if(tflags & TELEPORT_FLAG_PARTICLES)
{
Send_Effect(EFFECT_TELEPORT, player.origin, '0 0 0', 1);
#ifdef SVQC
if(e.speed)
- if(vlen(player.velocity) > e.speed)
+ if(vdist(player.velocity, >, e.speed))
player.velocity = normalize(player.velocity) * max(0, e.speed);
#elif defined(CSQC)
if(e.speed)
- if(vlen(player.move_velocity) > e.speed)
+ if(vdist(player.move_velocity, >, e.speed))
player.move_velocity = normalize(player.move_velocity) * max(0, e.speed);
#endif
#ifdef SVQC
if(STAT(TELEPORT_MAXSPEED, player))
- if(vlen(player.velocity) > STAT(TELEPORT_MAXSPEED, player))
+ if(vdist(player.velocity, >, STAT(TELEPORT_MAXSPEED, player)))
player.velocity = normalize(player.velocity) * max(0, STAT(TELEPORT_MAXSPEED, player));
#elif defined(CSQC)
if(STAT(TELEPORT_MAXSPEED, player))
- if(vlen(player.move_velocity) > STAT(TELEPORT_MAXSPEED, player))
+ if(vdist(player.move_velocity, >, STAT(TELEPORT_MAXSPEED, player)))
player.move_velocity = normalize(player.move_velocity) * max(0, STAT(TELEPORT_MAXSPEED, player));
#endif