-
- if(self.enemy)
- {
- e = self.enemy;
- }
- else
- {
- RandomSelection_Init();
- for(e = world; (e = find(e, targetname, self.target)); )
- {
- p = 1;
- if(autocvar_g_telefrags_avoid)
- {
- o = e.origin + '0 0 1' * (1 - other.mins_z - 24);
- if(check_tdeath(other, o, '0 0 0', '0 0 0'))
- p = 0;
- }
- if(e.cnt)
- RandomSelection_Add(e, 0, string_null, e.cnt, p);
- else
- RandomSelection_Add(e, 0, string_null, 1, p);
- }
- e = RandomSelection_chosen_ent;
- }
-
- if(!e)
- {
- sprint(other, "Teleport destination vanished. Sorry... please complain to the mapper.\n");
- }
-
- if(e.speed)
- if(vlen(other.velocity) > e.speed)
- other.velocity = normalize(other.velocity) * max(0, e.speed);
- if(autocvar_g_teleport_maxspeed)
- if(vlen(other.velocity) > autocvar_g_teleport_maxspeed)
- other.velocity = normalize(other.velocity) * max(0, autocvar_g_teleport_maxspeed);
-
- o = e.origin + '0 0 1' * (1 - other.mins_z - 24);
- TeleportPlayer(self, other, o, e.mangle, v_forward * vlen(other.velocity), '0 0 0', '0 0 0', TELEPORT_FLAGS_TELEPORTER);