Remove race conditions from where SP.AbsolutePosition could change between the various property checks.

ghosts
Justin Clark-Casey (justincc) 2014-08-26 18:25:14 +01:00
parent 42bb122232
commit bafa82eb12
1 changed files with 4 additions and 7 deletions

View File

@ -525,16 +525,13 @@ namespace OpenSim.Region.CoreModules.World.Land
/// </summary> /// </summary>
/// <param name="avatar"></param> /// <param name="avatar"></param>
public void EventManagerOnClientMovement(ScenePresence avatar) public void EventManagerOnClientMovement(ScenePresence avatar)
//
{ {
ILandObject over = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); Vector3 pos = avatar.AbsolutePosition;
ILandObject over = GetLandObject(pos.X, pos.Y);
if (over != null) if (over != null)
{ {
if (!over.IsRestrictedFromLand(avatar.UUID) && (!over.IsBannedFromLand(avatar.UUID) || avatar.AbsolutePosition.Z >= LandChannel.BAN_LINE_SAFETY_HIEGHT)) if (!over.IsRestrictedFromLand(avatar.UUID) && (!over.IsBannedFromLand(avatar.UUID) || pos.Z >= LandChannel.BAN_LINE_SAFETY_HIEGHT))
{ avatar.lastKnownAllowedPosition = pos;
avatar.lastKnownAllowedPosition =
new Vector3(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z);
}
} }
} }