diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 1874826..b1066b5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -2202,6 +2202,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2202 | } | 2202 | } |
2203 | } | 2203 | } |
2204 | 2204 | ||
2205 | public LSL_Vector osNpcGetPos(LSL_Key npc) | ||
2206 | { | ||
2207 | CheckThreatLevel(ThreatLevel.High, "osNpcGetPos"); | ||
2208 | |||
2209 | INPCModule npcModule = World.RequestModuleInterface<INPCModule>(); | ||
2210 | if (npcModule != null) | ||
2211 | { | ||
2212 | UUID npcId; | ||
2213 | if (!UUID.TryParse(npc.m_string, out npcId)) | ||
2214 | return new LSL_Vector(0, 0, 0); | ||
2215 | |||
2216 | if (!npcModule.IsNPC(npcId, m_host.ParentGroup.Scene)) | ||
2217 | return new LSL_Vector(0, 0, 0); | ||
2218 | |||
2219 | Vector3 pos = World.GetScenePresence(npcId).AbsolutePosition; | ||
2220 | return new LSL_Vector(pos.X, pos.Y, pos.Z); | ||
2221 | } | ||
2222 | |||
2223 | return new LSL_Vector(0, 0, 0); | ||
2224 | } | ||
2225 | |||
2205 | public void osNpcMoveTo(LSL_Key npc, LSL_Vector position) | 2226 | public void osNpcMoveTo(LSL_Key npc, LSL_Vector position) |
2206 | { | 2227 | { |
2207 | CheckThreatLevel(ThreatLevel.High, "osNpcMoveTo"); | 2228 | CheckThreatLevel(ThreatLevel.High, "osNpcMoveTo"); |