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

0.8-extended
Justin Clark-Casey (justincc) 2014-08-26 18:25:14 +01:00 committed by Justin Clark-Casey
parent a068c1dd9d
commit 5614b28886
1 changed files with 4 additions and 7 deletions

View File

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