Use consistent GroupPosition value Make SOP.UpdateGroupPosition() rather than one that could change whilst the method is being executed.

user_profiles
Justin Clark-Casey (justincc) 2013-04-03 00:23:20 +01:00
parent c0319daa40
commit 97f0c9da84
1 changed files with 6 additions and 5 deletions

View File

@ -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();
}