From 97f0c9da84f9a3a73a63c209012260fa2c59c0de Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 3 Apr 2013 00:23:20 +0100 Subject: Use consistent GroupPosition value Make SOP.UpdateGroupPosition() rather than one that could change whilst the method is being executed. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 3e816fc..7697411 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3902,13 +3902,14 @@ namespace OpenSim.Region.Framework.Scenes } } - public void UpdateGroupPosition(Vector3 pos) + public void UpdateGroupPosition(Vector3 newPos) { - if ((pos.X != GroupPosition.X) || - (pos.Y != GroupPosition.Y) || - (pos.Z != GroupPosition.Z)) + Vector3 oldPos = GroupPosition; + + if ((newPos.X != oldPos.X) || + (newPos.Y != oldPos.Y) || + (newPos.Z != oldPos.Z)) { - Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z); GroupPosition = newPos; ScheduleTerseUpdate(); } -- cgit v1.1