diff options
author | Justin Clark-Casey (justincc) | 2011-08-03 04:19:19 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-03 04:19:19 +0100 |
commit | 6e4ec2972266ae250337867fe1ba1944131f212d (patch) | |
tree | db0d334a9d0cc871bbdd83b86d703260befa25b5 /OpenSim/Region/CoreModules | |
parent | Improve z axis move to/autopilot so the avatar does alternative crouch/huzzah... (diff) | |
download | opensim-SC-6e4ec2972266ae250337867fe1ba1944131f212d.zip opensim-SC-6e4ec2972266ae250337867fe1ba1944131f212d.tar.gz opensim-SC-6e4ec2972266ae250337867fe1ba1944131f212d.tar.bz2 opensim-SC-6e4ec2972266ae250337867fe1ba1944131f212d.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 69 |
1 files changed, 32 insertions, 37 deletions
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 | |||
470 | SendLandUpdate(avatar, false); | 470 | SendLandUpdate(avatar, false); |
471 | } | 471 | } |
472 | 472 | ||
473 | public void EventManagerOnSignificantClientMovement(IClientAPI remote_client) | 473 | public void EventManagerOnSignificantClientMovement(ScenePresence clientAvatar) |
474 | { | 474 | { |
475 | ScenePresence clientAvatar = m_scene.GetScenePresence(remote_client.AgentId); | 475 | SendLandUpdate(clientAvatar); |
476 | 476 | SendOutNearestBanLine(clientAvatar.ControllingClient); | |
477 | if (clientAvatar != null) | 477 | ILandObject parcel = GetLandObject(clientAvatar.AbsolutePosition.X, clientAvatar.AbsolutePosition.Y); |
478 | if (parcel != null) | ||
478 | { | 479 | { |
479 | SendLandUpdate(clientAvatar); | 480 | if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && |
480 | SendOutNearestBanLine(remote_client); | 481 | clientAvatar.sentMessageAboutRestrictedParcelFlyingDown) |
481 | ILandObject parcel = GetLandObject(clientAvatar.AbsolutePosition.X, clientAvatar.AbsolutePosition.Y); | ||
482 | if (parcel != null) | ||
483 | { | 482 | { |
484 | if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && | 483 | EventManagerOnAvatarEnteringNewParcel(clientAvatar, parcel.LandData.LocalID, |
485 | clientAvatar.sentMessageAboutRestrictedParcelFlyingDown) | 484 | m_scene.RegionInfo.RegionID); |
485 | //They are going under the safety line! | ||
486 | if (!parcel.IsBannedFromLand(clientAvatar.UUID)) | ||
486 | { | 487 | { |
487 | EventManagerOnAvatarEnteringNewParcel(clientAvatar, parcel.LandData.LocalID, | 488 | clientAvatar.sentMessageAboutRestrictedParcelFlyingDown = false; |
488 | m_scene.RegionInfo.RegionID); | ||
489 | //They are going under the safety line! | ||
490 | if (!parcel.IsBannedFromLand(clientAvatar.UUID)) | ||
491 | { | ||
492 | clientAvatar.sentMessageAboutRestrictedParcelFlyingDown = false; | ||
493 | } | ||
494 | } | 489 | } |
495 | else if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && | 490 | } |
496 | parcel.IsBannedFromLand(clientAvatar.UUID)) | 491 | else if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && |
492 | parcel.IsBannedFromLand(clientAvatar.UUID)) | ||
493 | { | ||
494 | //once we've sent the message once, keep going toward the target until we are done | ||
495 | if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId)) | ||
497 | { | 496 | { |
498 | //once we've sent the message once, keep going toward the target until we are done | 497 | SendYouAreBannedNotice(clientAvatar); |
499 | if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId)) | 498 | ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); |
500 | { | ||
501 | SendYouAreBannedNotice(clientAvatar); | ||
502 | ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); | ||
503 | } | ||
504 | } | 499 | } |
505 | else if (parcel.IsRestrictedFromLand(clientAvatar.UUID)) | 500 | } |
506 | { | 501 | else if (parcel.IsRestrictedFromLand(clientAvatar.UUID)) |
507 | //once we've sent the message once, keep going toward the target until we are done | 502 | { |
508 | if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId)) | 503 | //once we've sent the message once, keep going toward the target until we are done |
509 | { | 504 | if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId)) |
510 | SendYouAreRestrictedNotice(clientAvatar); | ||
511 | ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); | ||
512 | } | ||
513 | } | ||
514 | else | ||
515 | { | 505 | { |
516 | //when we are finally in a safe place, lets release the forced position lock | 506 | SendYouAreRestrictedNotice(clientAvatar); |
517 | forcedPosition.Remove(clientAvatar.ControllingClient.AgentId); | 507 | ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); |
518 | } | 508 | } |
519 | } | 509 | } |
510 | else | ||
511 | { | ||
512 | //when we are finally in a safe place, lets release the forced position lock | ||
513 | forcedPosition.Remove(clientAvatar.ControllingClient.AgentId); | ||
514 | } | ||
520 | } | 515 | } |
521 | } | 516 | } |
522 | 517 | ||