aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorSignpostMarv2012-07-12 17:22:43 +0100
committerJustin Clark-Casey (justincc)2012-07-14 01:45:34 +0100
commite3453dd9ca1d08664a38205f05340623118a9880 (patch)
tree0f43bf9d1c669560d5c650d33dac5d1459ef994d /OpenSim/Region
parentadding workaround for silent failure if position is outside the bounds of a r... (diff)
downloadopensim-SC_OLD-e3453dd9ca1d08664a38205f05340623118a9880.zip
opensim-SC_OLD-e3453dd9ca1d08664a38205f05340623118a9880.tar.gz
opensim-SC_OLD-e3453dd9ca1d08664a38205f05340623118a9880.tar.bz2
opensim-SC_OLD-e3453dd9ca1d08664a38205f05340623118a9880.tar.xz
added in some extra variables, it sometimes thinks it is on the same parcel :(
Signed-off-by: SignpostMarv <github@signpostmarv.name>
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs12
1 files changed, 7 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 8163267..ca240f5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1946,10 +1946,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1946 else{ 1946 else{
1947 LSL_List parcelID = new LSL_List(ScriptBaseClass.PARCEL_DETAILS_ID); 1947 LSL_List parcelID = new LSL_List(ScriptBaseClass.PARCEL_DETAILS_ID);
1948 Vector3 objectPos = m_host.ParentGroup.RootPart.AbsolutePosition; 1948 Vector3 objectPos = m_host.ParentGroup.RootPart.AbsolutePosition;
1949 bool sameParcel = 1949 string parcelA = llGetParcelDetails(new LSL_Vector(objectPos.X, objectPos.X, objectPos.X), parcelID).Data[0].ToString();
1950 llGetParcelDetails(new LSL_Vector(pos.x, pos.y, pos.z), parcelID).Data[0] == 1950 string parcelB = llGetParcelDetails(pos, parcelID).Data[0].ToString();
1951 llGetParcelDetails(pos, parcelID).Data[0] 1951 bool sameParcel = parcelA == parcelB;
1952 ; 1952 int objectPrimCount = m_host.ParentGroup.PrimCount;
1953 LSL_Integer destParcelPrimCount = llGetParcelPrimCount(pos, ScriptBaseClass.PARCEL_COUNT_TOTAL, 0);
1954 LSL_Integer max = llGetParcelMaxPrims(pos, 0);
1953 if ( 1955 if (
1954 llGetStatus((int)PrimFlags.Physics) == 1 || // return FALSE if physical. 1956 llGetStatus((int)PrimFlags.Physics) == 1 || // return FALSE if physical.
1955 m_host.ParentGroup.IsAttachment || // return FALSE if attachment 1957 m_host.ParentGroup.IsAttachment || // return FALSE if attachment
@@ -1964,7 +1966,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1964 // this check will only work if pos is within the region bounds. 1966 // this check will only work if pos is within the region bounds.
1965 ( 1967 (
1966 !sameParcel && // if it's moving within the same parcel we do not need to check if the destination parcel will exceed capacity if the object is moved. 1968 !sameParcel && // if it's moving within the same parcel we do not need to check if the destination parcel will exceed capacity if the object is moved.
1967 (llGetParcelPrimCount(pos, ScriptBaseClass.PARCEL_COUNT_TOTAL, 0) + m_host.ParentGroup.PrimCount) > llGetParcelMaxPrims(pos, 0) 1969 (destParcelPrimCount + objectPrimCount) > max
1968 ) 1970 )
1969 // END RELIANCE ON WORK-AROUND 1971 // END RELIANCE ON WORK-AROUND
1970 ){ 1972 ){