aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-11 23:36:22 +0100
committerJustin Clark-Casey (justincc)2011-08-11 23:36:22 +0100
commitd23d37d2aa7c5a3d9c6ec1726aef7941d5e52519 (patch)
treeae887e5ecc536051531cb3803c0a43c03cd559be /OpenSim/Region/ScriptEngine/Shared/Api
parentimplement osNpcGetRot() and osNpcSetRot() (diff)
downloadopensim-SC_OLD-d23d37d2aa7c5a3d9c6ec1726aef7941d5e52519.zip
opensim-SC_OLD-d23d37d2aa7c5a3d9c6ec1726aef7941d5e52519.tar.gz
opensim-SC_OLD-d23d37d2aa7c5a3d9c6ec1726aef7941d5e52519.tar.bz2
opensim-SC_OLD-d23d37d2aa7c5a3d9c6ec1726aef7941d5e52519.tar.xz
implement osNpcGetPos()
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs21
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs5
3 files changed, 27 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");
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 7c08e84..9f0d07c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -171,6 +171,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
171 key osNpcCreate(string user, string name, vector position, key cloneFrom); 171 key osNpcCreate(string user, string name, vector position, key cloneFrom);
172 LSL_Key osNpcSaveAppearance(key npc, string notecardName); 172 LSL_Key osNpcSaveAppearance(key npc, string notecardName);
173 void osNpcLoadAppearance(key npc, string notecardNameOrUuid); 173 void osNpcLoadAppearance(key npc, string notecardNameOrUuid);
174 vector osNpcGetPos(key npc);
174 void osNpcMoveTo(key npc, vector position); 175 void osNpcMoveTo(key npc, vector position);
175 void osNpcMoveToTarget(key npc, vector position, int options); 176 void osNpcMoveToTarget(key npc, vector position, int options);
176 rotation osNpcGetRot(key npc); 177 rotation osNpcGetRot(key npc);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index e8e5f52..3ccb3f1 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -493,6 +493,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
493 m_OSSL_Functions.osNpcLoadAppearance(npc, notecardNameOrUuid); 493 m_OSSL_Functions.osNpcLoadAppearance(npc, notecardNameOrUuid);
494 } 494 }
495 495
496 public vector osNpcGetPos(LSL_Key npc)
497 {
498 return m_OSSL_Functions.osNpcGetPos(npc);
499 }
500
496 public void osNpcMoveTo(key npc, vector position) 501 public void osNpcMoveTo(key npc, vector position)
497 { 502 {
498 m_OSSL_Functions.osNpcMoveTo(npc, position); 503 m_OSSL_Functions.osNpcMoveTo(npc, position);