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/OptionalModules/World/NPC/NPCModule.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/OptionalModules') 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; } -- cgit v1.1 From 4186fa10f0eba3628ef8222db2e4b0e2b69df5cd Mon Sep 17 00:00:00 2001 From: dahlia Date: Mon, 7 May 2012 00:08:56 -0700 Subject: remove default values from prior commit since mono cant deal with them --- OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 2 +- OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/OptionalModules') diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 541ad7d..d3456ab 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, bool running = false) + public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget, bool running) { lock (m_avatars) { diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs index a39257e..65dad2d 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs @@ -242,7 +242,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); Vector3 targetPos = startPos + new Vector3(0, 10, 0); - m_npcMod.MoveToTarget(npc.UUID, m_scene, targetPos, false, false); + m_npcMod.MoveToTarget(npc.UUID, m_scene, targetPos, false, false, false); Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); //Assert.That(npc.Rotation, Is.EqualTo(new Quaternion(0, 0, 0.7071068f, 0.7071068f))); @@ -267,7 +267,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests // Try a second movement startPos = npc.AbsolutePosition; targetPos = startPos + new Vector3(10, 0, 0); - m_npcMod.MoveToTarget(npc.UUID, m_scene, targetPos, false, false); + m_npcMod.MoveToTarget(npc.UUID, m_scene, targetPos, false, false, false); Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); // Assert.That(npc.Rotation, Is.EqualTo(new Quaternion(0, 0, 0, 1))); -- cgit v1.1