add OS_NPC_RUNNING option to osNpcMoveToTarget() to allow running speed for moving NPCs

0.7.4.1
dahlia 2012-05-06 23:54:50 -07:00
parent b60f51dafc
commit b697d0e895
4 changed files with 9 additions and 4 deletions

View File

@ -113,9 +113,11 @@ namespace OpenSim.Region.Framework.Interfaces
/// </param> /// </param>
/// <param name="landAtTarget"> /// <param name="landAtTarget">
/// If true and the avatar is flying when it reaches the target, land. /// If true and the avatar is flying when it reaches the target, land.
/// </param> /// </param> name="running">
/// If true, NPC moves with running speed.
/// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns> /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns>
bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget); ///
bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget, bool running = false);
/// <summary> /// <summary>
/// Stop the NPC's current movement. /// Stop the NPC's current movement.

View File

@ -169,7 +169,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
} }
} }
public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget) public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget, bool running = false)
{ {
lock (m_avatars) lock (m_avatars)
{ {
@ -183,6 +183,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
sp.Name, pos, scene.RegionInfo.RegionName, noFly, landAtTarget); sp.Name, pos, scene.RegionInfo.RegionName, noFly, landAtTarget);
sp.MoveToTarget(pos, noFly, landAtTarget); sp.MoveToTarget(pos, noFly, landAtTarget);
sp.SetAlwaysRun = running;
return true; return true;
} }

View File

@ -2474,7 +2474,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
World, World,
pos, pos,
(options & ScriptBaseClass.OS_NPC_NO_FLY) != 0, (options & ScriptBaseClass.OS_NPC_NO_FLY) != 0,
(options & ScriptBaseClass.OS_NPC_LAND_AT_TARGET) != 0); (options & ScriptBaseClass.OS_NPC_LAND_AT_TARGET) != 0,
(options & ScriptBaseClass.OS_NPC_RUNNING) != 0);
} }
} }

View File

@ -626,6 +626,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int OS_NPC_FLY = 0; public const int OS_NPC_FLY = 0;
public const int OS_NPC_NO_FLY = 1; public const int OS_NPC_NO_FLY = 1;
public const int OS_NPC_LAND_AT_TARGET = 2; public const int OS_NPC_LAND_AT_TARGET = 2;
public const int OS_NPC_RUNNING = 4;
public const int OS_NPC_SIT_NOW = 0; public const int OS_NPC_SIT_NOW = 0;