Fixes more casting and null propogation

This commit is contained in:
Kamron Batman 2018-09-11 16:20:57 -07:00
parent 403e2a8b9d
commit f211efc3bd
7 changed files with 242 additions and 412 deletions

View file

@ -3597,6 +3597,7 @@ namespace Server
{
if ( m_Deleted )
return;
if ( !World.OnDelete( this ) )
return;
@ -3630,11 +3631,8 @@ namespace Server
m_Deleted = true;
if ( m_Map != null )
{
m_Map.OnLeave( this );
m_Map = null;
}
m_Map?.OnLeave( this );
m_Map = null;
m_Hair = null;
m_FacialHair = null;
@ -3652,11 +3650,8 @@ namespace Server
/// </summary>
public virtual void OnDelete()
{
if ( m_Spawner != null )
{
m_Spawner.Remove( this );
m_Spawner = null;
}
m_Spawner?.Remove( this );
m_Spawner = null;
}
/// <summary>