* Fix walking to <NaN, NaN, NaN> via autopilot.

user_profiles
teravus 2013-02-16 22:54:37 -05:00
parent e549c2922a
commit 6560d80fa8
1 changed files with 5 additions and 1 deletions

View File

@ -1847,7 +1847,11 @@ namespace OpenSim.Region.Framework.Scenes
// Get terrain height for sub-region in a megaregion if necessary
int X = (int)((m_scene.RegionInfo.RegionLocX * Constants.RegionSize) + pos.X);
int Y = (int)((m_scene.RegionInfo.RegionLocY * Constants.RegionSize) + pos.Y);
UUID target_regionID = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, X, Y).RegionID;
GridRegion target_region = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, X, Y);
// If X and Y is NaN, target_region will be null
if (target_region == null)
return;
UUID target_regionID = target_region.RegionID;
Scene targetScene = m_scene;
if (!SceneManager.Instance.TryGetScene(target_regionID, out targetScene))