From b697d0e895dc7670e160188501da88a780455500 Mon Sep 17 00:00:00 2001
From: dahlia
Date: Sun, 6 May 2012 23:54:50 -0700
Subject: add OS_NPC_RUNNING option to osNpcMoveToTarget() to allow running
speed for moving NPCs
---
OpenSim/Region/Framework/Interfaces/INPCModule.cs | 6 ++++--
OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 3 ++-
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 3 ++-
OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | 1 +
4 files changed, 9 insertions(+), 4 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
index b4dc3c3..e071ea3 100644
--- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
@@ -113,9 +113,11 @@ namespace OpenSim.Region.Framework.Interfaces
///
///
/// If true and the avatar is flying when it reaches the target, land.
- ///
+ /// name="running">
+ /// If true, NPC moves with running speed.
/// True if the operation succeeded, false if there was no such agent or the agent was not an NPC
- 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);
///
/// Stop the NPC's current movement.
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index 3ac1eb1..541ad7d 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -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)
{
@@ -183,6 +183,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
sp.Name, pos, scene.RegionInfo.RegionName, noFly, landAtTarget);
sp.MoveToTarget(pos, noFly, landAtTarget);
+ sp.SetAlwaysRun = running;
return true;
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 0d4ea19..3659687 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2474,7 +2474,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
World,
pos,
(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);
}
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index fd7c41e..2a28542 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -626,6 +626,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int OS_NPC_FLY = 0;
public const int OS_NPC_NO_FLY = 1;
public const int OS_NPC_LAND_AT_TARGET = 2;
+ public const int OS_NPC_RUNNING = 4;
public const int OS_NPC_SIT_NOW = 0;
--
cgit v1.1