aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorUbitUmarov2014-10-26 10:08:13 +0000
committerUbitUmarov2014-10-26 10:08:13 +0000
commit6600282fe99fc1a3c7ff7b80f8aedbac8fe69015 (patch)
treed6b9a22ba369d00f4517f5d8d0b1ff2d018a1280 /OpenSim/Region/Framework
parent bug fix (diff)
downloadopensim-SC_OLD-6600282fe99fc1a3c7ff7b80f8aedbac8fe69015.zip
opensim-SC_OLD-6600282fe99fc1a3c7ff7b80f8aedbac8fe69015.tar.gz
opensim-SC_OLD-6600282fe99fc1a3c7ff7b80f8aedbac8fe69015.tar.bz2
opensim-SC_OLD-6600282fe99fc1a3c7ff7b80f8aedbac8fe69015.tar.xz
another try to prevent double crossing
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs98
1 files changed, 46 insertions, 52 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 9f2a689..b9b5621 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -530,77 +530,71 @@ namespace OpenSim.Region.Framework.Scenes
530 { 530 {
531 Vector3 val = value; 531 Vector3 val = value;
532 532
533 if (Scene != null && !inTransit) 533 if (!IsAttachmentCheckFull() && !Scene.LoadingPrims &&
534 ( Scene.TestBorderCross(val, Cardinals.E) ||
535 Scene.TestBorderCross(val, Cardinals.W) ||
536 Scene.TestBorderCross(val, Cardinals.N) ||
537 Scene.TestBorderCross(val, Cardinals.S))
538 )
534 { 539 {
535 if ( 540 lock (m_parts)
536 // (Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E)
537 // || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
538 // || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N)
539 // || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
540 // Experimental change for better border crossings.
541 // The commented out original lines above would, it seems, trigger
542 // a border crossing a little early or late depending on which
543 // direction the object was moving.
544 (Scene.TestBorderCross(val, Cardinals.E)
545 || Scene.TestBorderCross(val, Cardinals.W)
546 || Scene.TestBorderCross(val, Cardinals.N)
547 || Scene.TestBorderCross(val, Cardinals.S))
548 && !IsAttachmentCheckFull() && (!Scene.LoadingPrims))
549 { 541 {
550 inTransit = true; 542 if (!inTransit)
551 SOGCrossDelegate d = CrossAsync; 543 {
552 d.BeginInvoke(this, val, CrossAsyncCompleted, d); 544 inTransit = true;
545 SOGCrossDelegate d = CrossAsync;
546 d.BeginInvoke(this, val, CrossAsyncCompleted, d);
547 }
553 return; 548 return;
554 } 549 }
550 }
555 551
556 552 if (RootPart.GetStatusSandbox())
557 if (RootPart.GetStatusSandbox()) 553 {
554 if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10)
558 { 555 {
559 if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10) 556 RootPart.ScriptSetPhysicsStatus(false);
560 {
561 RootPart.ScriptSetPhysicsStatus(false);
562 557
563 if (Scene != null) 558 if (Scene != null)
564 Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"), 559 Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
565 ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false); 560 ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
566 561
567 return; 562 return;
568 }
569 } 563 }
564 }
570 565
571 bool triggerScriptEvent = m_rootPart.GroupPosition != val; 566 bool triggerScriptEvent = m_rootPart.GroupPosition != val;
572 if (m_dupeInProgress || IsDeleted) 567 if (m_dupeInProgress || IsDeleted)
573 triggerScriptEvent = false; 568 triggerScriptEvent = false;
574 569
575 m_rootPart.GroupPosition = val; 570 m_rootPart.GroupPosition = val;
576 571
577 // Restuff the new GroupPosition into each child SOP of the linkset. 572 // Restuff the new GroupPosition into each child SOP of the linkset.
578 // this is needed because physics may not have linksets but just loose SOPs in world 573 // this is needed because physics may not have linksets but just loose SOPs in world
579 574
580 SceneObjectPart[] parts = m_parts.GetArray(); 575 SceneObjectPart[] parts = m_parts.GetArray();
581 576
582 foreach (SceneObjectPart part in parts) 577 foreach (SceneObjectPart part in parts)
583 { 578 {
584 if (part != m_rootPart) 579 if (part != m_rootPart)
585 part.GroupPosition = val; 580 part.GroupPosition = val;
586 } 581 }
587 582
588 foreach (ScenePresence av in m_linkedAvatars) 583 foreach (ScenePresence av in m_linkedAvatars)
589 { 584 {
590 av.sitSOGmoved(); 585 av.sitSOGmoved();
591 } 586 }
592 587
593 // now that position is changed tell it to scripts 588 // now that position is changed tell it to scripts
594 if (triggerScriptEvent) 589 if (triggerScriptEvent)
590 {
591 foreach (SceneObjectPart part in parts)
595 { 592 {
596 foreach (SceneObjectPart part in parts) 593 part.TriggerScriptChangedEvent(Changed.POSITION);
597 {
598 part.TriggerScriptChangedEvent(Changed.POSITION);
599 }
600 } 594 }
601
602 Scene.EventManager.TriggerParcelPrimCountTainted();
603 } 595 }
596
597 Scene.EventManager.TriggerParcelPrimCountTainted();
604 } 598 }
605 } 599 }
606 600