early code to allow scripts to force npcs not to fly when moving to target

this is to allow walking on prims.  it will be up to the script writer to be sure that there is a continuous path.
currently implemented in osNpcMoveToTarget(), but none of this is final.
This commit is contained in:
Justin Clark-Casey (justincc)
2011-08-10 01:47:37 +01:00
parent 4cb8d6379d
commit 5d6c9644fa
15 changed files with 45 additions and 18 deletions

View File

@@ -2209,7 +2209,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (module != null)
{
Vector3 pos = new Vector3((float) position.x, (float) position.y, (float) position.z);
module.MoveToTarget(new UUID(npc.m_string), World, pos);
module.MoveToTarget(new UUID(npc.m_string), World, pos, false);
}
}
public void osNpcMoveToTarget(LSL_Key npc, LSL_Vector position, int noFly)
{
CheckThreatLevel(ThreatLevel.High, "osNpcMoveToTarget");
INPCModule module = World.RequestModuleInterface<INPCModule>();
if (module != null)
{
Vector3 pos = new Vector3((float) position.x, (float) position.y, (float) position.z);
module.MoveToTarget(new UUID(npc.m_string), World, pos, noFly != 0);
}
}

View File

@@ -173,6 +173,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_Key osNpcSaveAppearance(string avatar, string notecardName);
void osNpcLoadAppearance(string avatar, string notecardNameOrUuid);
void osNpcMoveTo(key npc, vector position);
void osNpcMoveToTarget(key npc, vector position, int noFly);
void osNpcStopMoveTo(LSL_Key npc);
void osNpcSay(key npc, string message);
void osNpcRemove(key npc);

View File

@@ -498,6 +498,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osNpcMoveTo(npc, position);
}
public void osNpcMoveToTarget(key npc, vector position, int noFly)
{
m_OSSL_Functions.osNpcMoveToTarget(npc, position, noFly);
}
public void osNpcStopMoveTo(LSL_Key npc)
{
m_OSSL_Functions.osNpcStopMoveTo(npc);