From 6e4ec2972266ae250337867fe1ba1944131f212d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 3 Aug 2011 04:19:19 +0100 Subject: Do a partial fix/implementation of OSSL osNpcMoveTo() Avatar moves and stops. However, will stop in mid stride. And if the move to position is in the air, avatar will continue to make vain and quite hilarious attempts to take off (but never doing so). Clearly more work is needed. --- .../CoreModules/World/Land/LandManagementModule.cs | 69 ++++++++++------------ 1 file changed, 32 insertions(+), 37 deletions(-) (limited to 'OpenSim/Region/CoreModules/World') diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 63dec15..7554e12 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -470,53 +470,48 @@ namespace OpenSim.Region.CoreModules.World.Land SendLandUpdate(avatar, false); } - public void EventManagerOnSignificantClientMovement(IClientAPI remote_client) + public void EventManagerOnSignificantClientMovement(ScenePresence clientAvatar) { - ScenePresence clientAvatar = m_scene.GetScenePresence(remote_client.AgentId); - - if (clientAvatar != null) + SendLandUpdate(clientAvatar); + SendOutNearestBanLine(clientAvatar.ControllingClient); + ILandObject parcel = GetLandObject(clientAvatar.AbsolutePosition.X, clientAvatar.AbsolutePosition.Y); + if (parcel != null) { - SendLandUpdate(clientAvatar); - SendOutNearestBanLine(remote_client); - ILandObject parcel = GetLandObject(clientAvatar.AbsolutePosition.X, clientAvatar.AbsolutePosition.Y); - if (parcel != null) + if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && + clientAvatar.sentMessageAboutRestrictedParcelFlyingDown) { - if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && - clientAvatar.sentMessageAboutRestrictedParcelFlyingDown) + EventManagerOnAvatarEnteringNewParcel(clientAvatar, parcel.LandData.LocalID, + m_scene.RegionInfo.RegionID); + //They are going under the safety line! + if (!parcel.IsBannedFromLand(clientAvatar.UUID)) { - EventManagerOnAvatarEnteringNewParcel(clientAvatar, parcel.LandData.LocalID, - m_scene.RegionInfo.RegionID); - //They are going under the safety line! - if (!parcel.IsBannedFromLand(clientAvatar.UUID)) - { - clientAvatar.sentMessageAboutRestrictedParcelFlyingDown = false; - } + clientAvatar.sentMessageAboutRestrictedParcelFlyingDown = false; } - else if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && - parcel.IsBannedFromLand(clientAvatar.UUID)) + } + else if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && + parcel.IsBannedFromLand(clientAvatar.UUID)) + { + //once we've sent the message once, keep going toward the target until we are done + if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId)) { - //once we've sent the message once, keep going toward the target until we are done - if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId)) - { - SendYouAreBannedNotice(clientAvatar); - ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); - } + SendYouAreBannedNotice(clientAvatar); + ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); } - else if (parcel.IsRestrictedFromLand(clientAvatar.UUID)) - { - //once we've sent the message once, keep going toward the target until we are done - if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId)) - { - SendYouAreRestrictedNotice(clientAvatar); - ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); - } - } - else + } + else if (parcel.IsRestrictedFromLand(clientAvatar.UUID)) + { + //once we've sent the message once, keep going toward the target until we are done + if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId)) { - //when we are finally in a safe place, lets release the forced position lock - forcedPosition.Remove(clientAvatar.ControllingClient.AgentId); + SendYouAreRestrictedNotice(clientAvatar); + ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); } } + else + { + //when we are finally in a safe place, lets release the forced position lock + forcedPosition.Remove(clientAvatar.ControllingClient.AgentId); + } } } -- cgit v1.1