checks if we should teleport the player to a safe location and if so, performs the teleportation
1824 {
1825 if( player.GetSimulationTimeStamp() < 20 && !player.IsPersistentFlag(
PersistentFlag.AREA_PRESENCE) )
1826 {
1827
1828
1829
1830 vector player_pos = player.GetPosition();
1831 vector closest_safe_pos = MiscGameplayFunctions.GetClosestSafePos(player_pos, safe_positions);
1832
1833 if (player_pos!=closest_safe_pos)
1834 {
1835 closest_safe_pos[1] =
g_Game.SurfaceY(closest_safe_pos[0], closest_safe_pos[2]);
1836
1837 player.SetPosition( closest_safe_pos );
1838
1839 g_Game.RPCSingleParam(player,
ERPCs.RPC_WARNING_TELEPORT, null,
true, player.GetIdentity());
1840
1841 PluginAdminLog adminLog = PluginAdminLog.Cast(
GetPlugin(PluginAdminLog));
1842 if (adminLog)
1843 adminLog.PlayerTeleportedLog(player,player_pos,closest_safe_pos,"Unwillingly spawning in contaminated area.");
1844 }
1845
1847 }
1848 }
PluginBase GetPlugin(typename plugin_type)