diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rwxr-xr-x | OpenSim/Region/OptionalModules/Scripting/ExtendedPhysics/ExtendedPhysics.cs | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/ExtendedPhysics/ExtendedPhysics.cs b/OpenSim/Region/OptionalModules/Scripting/ExtendedPhysics/ExtendedPhysics.cs index d035f7b..90cf15a 100755 --- a/OpenSim/Region/OptionalModules/Scripting/ExtendedPhysics/ExtendedPhysics.cs +++ b/OpenSim/Region/OptionalModules/Scripting/ExtendedPhysics/ExtendedPhysics.cs | |||
@@ -315,7 +315,8 @@ public class ExtendedPhysics : INonSharedRegionModule | |||
315 | 315 | ||
316 | if (GetRootAndChildPhysActors(hostID, linkNum, out rootPhysActor, out childPhysActor)) | 316 | if (GetRootAndChildPhysActors(hostID, linkNum, out rootPhysActor, out childPhysActor)) |
317 | { | 317 | { |
318 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctChangeLinkType, childPhysActor, typeCode)); | 318 | object[] parms = { childPhysActor, typeCode }; |
319 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctChangeLinkType, parms)); | ||
319 | } | 320 | } |
320 | 321 | ||
321 | return ret; | 322 | return ret; |
@@ -323,7 +324,7 @@ public class ExtendedPhysics : INonSharedRegionModule | |||
323 | 324 | ||
324 | // physGetLinkType(integer linkNum) | 325 | // physGetLinkType(integer linkNum) |
325 | [ScriptInvocation] | 326 | [ScriptInvocation] |
326 | public int physGetLinkType(UUID hostID, UUID scriptID, int linkNum, int typeCode) | 327 | public int physGetLinkType(UUID hostID, UUID scriptID, int linkNum) |
327 | { | 328 | { |
328 | int ret = -1; | 329 | int ret = -1; |
329 | if (!Enabled) return ret; | 330 | if (!Enabled) return ret; |
@@ -333,7 +334,8 @@ public class ExtendedPhysics : INonSharedRegionModule | |||
333 | 334 | ||
334 | if (GetRootAndChildPhysActors(hostID, linkNum, out rootPhysActor, out childPhysActor)) | 335 | if (GetRootAndChildPhysActors(hostID, linkNum, out rootPhysActor, out childPhysActor)) |
335 | { | 336 | { |
336 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctGetLinkType, childPhysActor)); | 337 | object[] parms = { childPhysActor }; |
338 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctGetLinkType, parms)); | ||
337 | } | 339 | } |
338 | 340 | ||
339 | return ret; | 341 | return ret; |
@@ -352,7 +354,8 @@ public class ExtendedPhysics : INonSharedRegionModule | |||
352 | 354 | ||
353 | if (GetRootAndChildPhysActors(hostID, linkNum, out rootPhysActor, out childPhysActor)) | 355 | if (GetRootAndChildPhysActors(hostID, linkNum, out rootPhysActor, out childPhysActor)) |
354 | { | 356 | { |
355 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctChangeLinkType, childPhysActor, PHYS_LINK_TYPE_FIXED)); | 357 | object[] parms = { childPhysActor , PHYS_LINK_TYPE_FIXED }; |
358 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctChangeLinkType, parms)); | ||
356 | } | 359 | } |
357 | 360 | ||
358 | return ret; | 361 | return ret; |
@@ -409,7 +412,8 @@ public class ExtendedPhysics : INonSharedRegionModule | |||
409 | 412 | ||
410 | if (GetRootAndChildPhysActors(hostID, linkNum, out rootPhysActor, out childPhysActor)) | 413 | if (GetRootAndChildPhysActors(hostID, linkNum, out rootPhysActor, out childPhysActor)) |
411 | { | 414 | { |
412 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctChangeLinkParams, childPhysActor, parms)); | 415 | object[] parms2 = AddToBeginningOfArray(childPhysActor, parms); |
416 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctChangeLinkParams, parms2)); | ||
413 | } | 417 | } |
414 | 418 | ||
415 | return ret; | 419 | return ret; |
@@ -513,6 +517,15 @@ public class ExtendedPhysics : INonSharedRegionModule | |||
513 | return ret; | 517 | return ret; |
514 | } | 518 | } |
515 | 519 | ||
520 | // Return an array of objects with the passed object as the first object of a new array | ||
521 | private object[] AddToBeginningOfArray(object firstOne, object[] prevArray) | ||
522 | { | ||
523 | object[] newArray = new object[1 + prevArray.Length]; | ||
524 | newArray[0] = firstOne; | ||
525 | prevArray.CopyTo(newArray, 1); | ||
526 | return newArray; | ||
527 | } | ||
528 | |||
516 | // Extension() returns an object. Convert that object into the integer error we expect to return. | 529 | // Extension() returns an object. Convert that object into the integer error we expect to return. |
517 | private int MakeIntError(object extensionRet) | 530 | private int MakeIntError(object extensionRet) |
518 | { | 531 | { |