diff options
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index fc6bec1..0cc8829 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4641,7 +4641,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4641 | if (UUID.TryParse(agent, out agentId)) | 4641 | if (UUID.TryParse(agent, out agentId)) |
4642 | { | 4642 | { |
4643 | ScenePresence presence = World.GetScenePresence(agentId); | 4643 | ScenePresence presence = World.GetScenePresence(agentId); |
4644 | if (presence != null) | 4644 | if (presence != null && presence.PresenceType != PresenceType.Npc) |
4645 | { | 4645 | { |
4646 | // agent must not be a god | 4646 | // agent must not be a god |
4647 | if (presence.UserLevel >= 200) return; | 4647 | if (presence.UserLevel >= 200) return; |
@@ -4650,7 +4650,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4650 | if (m_host.OwnerID == World.LandChannel.GetLandObject( | 4650 | if (m_host.OwnerID == World.LandChannel.GetLandObject( |
4651 | presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) | 4651 | presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) |
4652 | { | 4652 | { |
4653 | World.TeleportClientHome(agentId, presence.ControllingClient); | 4653 | if (!World.TeleportClientHome(agentId, presence.ControllingClient)) |
4654 | { | ||
4655 | // They can't be teleported home for some reason | ||
4656 | GridRegion regionInfo = World.GridService.GetRegionByUUID(UUID.Zero, new UUID("2b02daac-e298-42fa-9a75-f488d37896e6")); | ||
4657 | if (regionInfo != null) | ||
4658 | { | ||
4659 | World.RequestTeleportLocation( | ||
4660 | presence.ControllingClient, regionInfo.RegionHandle, new Vector3(128, 128, 23), Vector3.Zero, | ||
4661 | (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome)); | ||
4662 | } | ||
4663 | } | ||
4654 | } | 4664 | } |
4655 | } | 4665 | } |
4656 | } | 4666 | } |
@@ -4664,7 +4674,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4664 | if (UUID.TryParse(agent, out agentId)) | 4674 | if (UUID.TryParse(agent, out agentId)) |
4665 | { | 4675 | { |
4666 | ScenePresence presence = World.GetScenePresence(agentId); | 4676 | ScenePresence presence = World.GetScenePresence(agentId); |
4667 | if (presence != null) | 4677 | if (presence != null && presence.PresenceType != PresenceType.Npc) |
4668 | { | 4678 | { |
4669 | // agent must not be a god | 4679 | // agent must not be a god |
4670 | if (presence.UserLevel >= 200) return; | 4680 | if (presence.UserLevel >= 200) return; |