From 7f499ff3f386d57bcd81ebb3f58f110011100604 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 10 Aug 2011 23:56:19 +0100 Subject: Add a OS_NPC_LAND_AT_TARGET option to osMoveToTarget() Default for this function is now not to automatically land. This allows better control by scripts when an avatar is going to be landing on a prim rather than the ground. Stopping the avatar involves faking a collision, to avoid the pid controller making it overshoot. A better approach would be to gradually slow the avatar as we near the target --- .../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 9b5d8d9..f83304b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2209,11 +2209,11 @@ 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, false); + module.MoveToTarget(new UUID(npc.m_string), World, pos, false, true); } } - public void osNpcMoveToTarget(LSL_Key npc, LSL_Vector position, int noFly) + public void osNpcMoveToTarget(LSL_Key npc, LSL_Vector position, int moveParams) { CheckThreatLevel(ThreatLevel.High, "osNpcMoveToTarget"); @@ -2221,7 +2221,12 @@ 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, noFly != 0); + module.MoveToTarget( + new UUID(npc.m_string), + World, + pos, + (moveParams & ScriptBaseClass.OS_NPC_NO_FLY) != 0, + (moveParams & ScriptBaseClass.OS_NPC_LAND_AT_TARGET) != 0); } } -- cgit v1.1