mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 22:26:09 +08:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user