checks if we should teleport the player to a safe location and if so, performs the teleportation
1691 {
1692 if( player.GetSimulationTimeStamp() < 20 && !player.IsPersistentFlag(
PersistentFlag.AREA_PRESENCE) )
1693 {
1694
1695
1696
1697 vector player_pos = player.GetPosition();
1698 vector closest_safe_pos = MiscGameplayFunctions.GetClosestSafePos(player_pos, safe_positions);
1699
1700 if (player_pos!=closest_safe_pos)
1701 {
1702 closest_safe_pos[1] =
g_Game.SurfaceY(closest_safe_pos[0], closest_safe_pos[2]);
1703
1704 player.SetPosition( closest_safe_pos );
1705
1706 g_Game.RPCSingleParam(player,
ERPCs.RPC_WARNING_TELEPORT, null,
true, player.GetIdentity());
1707
1708 PluginAdminLog adminLog = PluginAdminLog.Cast(
GetPlugin(PluginAdminLog));
1709 if (adminLog)
1710 adminLog.PlayerTeleportedLog(player,player_pos,closest_safe_pos,"Unwillingly spawning in contaminated area.");
1711 }
1712
1714 }
1715 }
PluginBase GetPlugin(typename plugin_type)