aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-10 23:56:19 +0100
committerJustin Clark-Casey (justincc)2011-08-10 23:56:19 +0100
commit7f499ff3f386d57bcd81ebb3f58f110011100604 (patch)
treebab34762e4a9cb9e739df591360cec3405bb4e57 /OpenSim/Region/ScriptEngine/Shared
parentfly and no fly constants for osNpcMoveToTarget() (diff)
downloadopensim-SC_OLD-7f499ff3f386d57bcd81ebb3f58f110011100604.zip
opensim-SC_OLD-7f499ff3f386d57bcd81ebb3f58f110011100604.tar.gz
opensim-SC_OLD-7f499ff3f386d57bcd81ebb3f58f110011100604.tar.bz2
opensim-SC_OLD-7f499ff3f386d57bcd81ebb3f58f110011100604.tar.xz
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
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs11
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs1
2 files changed, 9 insertions, 3 deletions
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
2209 if (module != null) 2209 if (module != null)
2210 { 2210 {
2211 Vector3 pos = new Vector3((float) position.x, (float) position.y, (float) position.z); 2211 Vector3 pos = new Vector3((float) position.x, (float) position.y, (float) position.z);
2212 module.MoveToTarget(new UUID(npc.m_string), World, pos, false); 2212 module.MoveToTarget(new UUID(npc.m_string), World, pos, false, true);
2213 } 2213 }
2214 } 2214 }
2215 2215
2216 public void osNpcMoveToTarget(LSL_Key npc, LSL_Vector position, int noFly) 2216 public void osNpcMoveToTarget(LSL_Key npc, LSL_Vector position, int moveParams)
2217 { 2217 {
2218 CheckThreatLevel(ThreatLevel.High, "osNpcMoveToTarget"); 2218 CheckThreatLevel(ThreatLevel.High, "osNpcMoveToTarget");
2219 2219
@@ -2221,7 +2221,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2221 if (module != null) 2221 if (module != null)
2222 { 2222 {
2223 Vector3 pos = new Vector3((float)position.x, (float)position.y, (float)position.z); 2223 Vector3 pos = new Vector3((float)position.x, (float)position.y, (float)position.z);
2224 module.MoveToTarget(new UUID(npc.m_string), World, pos, noFly != 0); 2224 module.MoveToTarget(
2225 new UUID(npc.m_string),
2226 World,
2227 pos,
2228 (moveParams & ScriptBaseClass.OS_NPC_NO_FLY) != 0,
2229 (moveParams & ScriptBaseClass.OS_NPC_LAND_AT_TARGET) != 0);
2225 } 2230 }
2226 } 2231 }
2227 2232
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 9ed894c..e82c281 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -594,6 +594,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
594 // Constants for osNpc* functions 594 // Constants for osNpc* functions
595 public const int OS_NPC_FLY = 0; 595 public const int OS_NPC_FLY = 0;
596 public const int OS_NPC_NO_FLY = 1; 596 public const int OS_NPC_NO_FLY = 1;
597 public const int OS_NPC_LAND_AT_TARGET = 2;
597 598
598 public const string URL_REQUEST_GRANTED = "URL_REQUEST_GRANTED"; 599 public const string URL_REQUEST_GRANTED = "URL_REQUEST_GRANTED";
599 public const string URL_REQUEST_DENIED = "URL_REQUEST_DENIED"; 600 public const string URL_REQUEST_DENIED = "URL_REQUEST_DENIED";