avoid some null refs

master
UbitUmarov 2020-07-24 13:24:55 +01:00
parent bb56157c92
commit e0aff5e640
1 changed files with 14 additions and 29 deletions

View File

@ -1226,13 +1226,14 @@ namespace OpenSim.Region.Framework.Scenes
Animator = null;
Appearance = null;
/* temporary out: timming issues
if(m_attachments != null)
{
foreach(SceneObjectGroup sog in m_attachments)
sog.Dispose();
m_attachments = null;
}
*/
scriptedcontrols.Clear();
ControllingClient = null;
}
@ -1654,19 +1655,7 @@ namespace OpenSim.Region.Framework.Scenes
*/
public int GetStateSource()
{
/*
AgentCircuitData aCircuit = m_scene.AuthenticateHandler.GetAgentCircuitData(UUID);
if (aCircuit != null && (aCircuit.teleportFlags != (uint)TeleportFlags.Default))
{
// This will get your attention
//m_log.Error("[XXX] Triggering CHANGED_TELEPORT");
return 5; // StateSource.Teleporting
}
return 2; // StateSource.PrimCrossing
*/
return m_teleportFlags == TeleportFlags.Default ? 2 : 5;
return m_teleportFlags == TeleportFlags.Default ? 2 : 5; // StateSource.PrimCrossing : StateSource.Teleporting
}
/// <summary>
@ -2190,7 +2179,7 @@ namespace OpenSim.Region.Framework.Scenes
catch { }
finally
{
m_updateAgentReceivedAfterTransferEvent.Reset();
m_updateAgentReceivedAfterTransferEvent?.Reset();
}
return false;
@ -4144,19 +4133,14 @@ namespace OpenSim.Region.Framework.Scenes
TriggerScenePresenceUpdated();
}
public void SendCoarseLocations(List<Vector3> coarseLocations, List<UUID> avatarUUIDs)
{
SendCoarseLocationsMethod d = m_sendCoarseLocationsMethod;
if (d != null)
{
d.Invoke(m_scene.RegionInfo.originRegionID, this, coarseLocations, avatarUUIDs);
}
}
public void SetSendCoarseLocationMethod(SendCoarseLocationsMethod d)
{
if (d != null)
m_sendCoarseLocationsMethod = d;
m_sendCoarseLocationsMethod = d;
}
public void SendCoarseLocations(List<Vector3> coarseLocations, List<UUID> avatarUUIDs)
{
m_sendCoarseLocationsMethod?.Invoke(m_scene.RegionInfo.originRegionID, this, coarseLocations, avatarUUIDs);
}
public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p, List<Vector3> coarseLocations, List<UUID> avatarUUIDs)
@ -4180,11 +4164,12 @@ namespace OpenSim.Region.Framework.Scenes
private void SendInitialData()
{
uint flags = ControllingClient.GetViewerCaps();
if ((flags & 0x1000) == 0) // wait for seeds sending
//wait for region handshake
if (NeedInitialData < 2)
return;
if (NeedInitialData < 2)
uint flags = ControllingClient.GetViewerCaps();
if ((flags & 0x1000) == 0) // wait for seeds sending
return;
// give some extra time to make sure viewers did process seeds