implement osNpcGetPos()
parent
a21e98ae1a
commit
d23d37d2aa
|
@ -2202,6 +2202,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LSL_Vector osNpcGetPos(LSL_Key npc)
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.High, "osNpcGetPos");
|
||||||
|
|
||||||
|
INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
|
||||||
|
if (npcModule != null)
|
||||||
|
{
|
||||||
|
UUID npcId;
|
||||||
|
if (!UUID.TryParse(npc.m_string, out npcId))
|
||||||
|
return new LSL_Vector(0, 0, 0);
|
||||||
|
|
||||||
|
if (!npcModule.IsNPC(npcId, m_host.ParentGroup.Scene))
|
||||||
|
return new LSL_Vector(0, 0, 0);
|
||||||
|
|
||||||
|
Vector3 pos = World.GetScenePresence(npcId).AbsolutePosition;
|
||||||
|
return new LSL_Vector(pos.X, pos.Y, pos.Z);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new LSL_Vector(0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
public void osNpcMoveTo(LSL_Key npc, LSL_Vector position)
|
public void osNpcMoveTo(LSL_Key npc, LSL_Vector position)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.High, "osNpcMoveTo");
|
CheckThreatLevel(ThreatLevel.High, "osNpcMoveTo");
|
||||||
|
|
|
@ -171,6 +171,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
key osNpcCreate(string user, string name, vector position, key cloneFrom);
|
key osNpcCreate(string user, string name, vector position, key cloneFrom);
|
||||||
LSL_Key osNpcSaveAppearance(key npc, string notecardName);
|
LSL_Key osNpcSaveAppearance(key npc, string notecardName);
|
||||||
void osNpcLoadAppearance(key npc, string notecardNameOrUuid);
|
void osNpcLoadAppearance(key npc, string notecardNameOrUuid);
|
||||||
|
vector osNpcGetPos(key npc);
|
||||||
void osNpcMoveTo(key npc, vector position);
|
void osNpcMoveTo(key npc, vector position);
|
||||||
void osNpcMoveToTarget(key npc, vector position, int options);
|
void osNpcMoveToTarget(key npc, vector position, int options);
|
||||||
rotation osNpcGetRot(key npc);
|
rotation osNpcGetRot(key npc);
|
||||||
|
|
|
@ -493,6 +493,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
m_OSSL_Functions.osNpcLoadAppearance(npc, notecardNameOrUuid);
|
m_OSSL_Functions.osNpcLoadAppearance(npc, notecardNameOrUuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public vector osNpcGetPos(LSL_Key npc)
|
||||||
|
{
|
||||||
|
return m_OSSL_Functions.osNpcGetPos(npc);
|
||||||
|
}
|
||||||
|
|
||||||
public void osNpcMoveTo(key npc, vector position)
|
public void osNpcMoveTo(key npc, vector position)
|
||||||
{
|
{
|
||||||
m_OSSL_Functions.osNpcMoveTo(npc, position);
|
m_OSSL_Functions.osNpcMoveTo(npc, position);
|
||||||
|
|
Loading…
Reference in New Issue