don't do dwell if there is no module active

0.9.0-post-fixes
UbitUmarov 2017-05-14 05:39:22 +01:00
parent 9ab8ce1404
commit f968118e23
1 changed files with 6 additions and 1 deletions

View File

@ -58,6 +58,7 @@ namespace OpenSim.Region.CoreModules.World.Land
protected ExpiringCache<UUID, bool> m_groupMemberCache = new ExpiringCache<UUID, bool>(); protected ExpiringCache<UUID, bool> m_groupMemberCache = new ExpiringCache<UUID, bool>();
protected TimeSpan m_groupMemberCacheTimeout = TimeSpan.FromSeconds(30); // cache invalidation after 30 seconds protected TimeSpan m_groupMemberCacheTimeout = TimeSpan.FromSeconds(30); // cache invalidation after 30 seconds
IDwellModule m_dwellModule;
private bool[,] m_landBitmap; private bool[,] m_landBitmap;
public bool[,] LandBitmap public bool[,] LandBitmap
@ -268,6 +269,7 @@ namespace OpenSim.Region.CoreModules.World.Land
{ {
LandData = landData.Copy(); LandData = landData.Copy();
m_scene = scene; m_scene = scene;
m_dwellModule = m_scene.RequestModuleInterface<IDwellModule>();
} }
public LandObject(UUID owner_id, bool is_group_owned, Scene scene, LandData data = null) public LandObject(UUID owner_id, bool is_group_owned, Scene scene, LandData data = null)
@ -276,7 +278,10 @@ namespace OpenSim.Region.CoreModules.World.Land
if (m_scene == null) if (m_scene == null)
LandBitmap = new bool[Constants.RegionSize / landUnit, Constants.RegionSize / landUnit]; LandBitmap = new bool[Constants.RegionSize / landUnit, Constants.RegionSize / landUnit];
else else
{
LandBitmap = new bool[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit]; LandBitmap = new bool[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit];
m_dwellModule = m_scene.RequestModuleInterface<IDwellModule>();
}
if(data == null) if(data == null)
LandData = new LandData(); LandData = new LandData();
@ -1819,7 +1824,7 @@ namespace OpenSim.Region.CoreModules.World.Land
} }
// need to update dwell here bc landdata has no parent info // need to update dwell here bc landdata has no parent info
if(LandData != null) if(LandData != null && m_dwellModule != null)
{ {
double now = Util.GetTimeStampMS(); double now = Util.GetTimeStampMS();
double elapsed = now - LandData.LastDwellTimeMS; double elapsed = now - LandData.LastDwellTimeMS;