public void CheckRespawn()
{
bool canSpawn = ( m_Content != null && !Deleted && GetItemsCount() <= SpawnThreshold && !Movable && Parent == null && !IsLockedDown && !IsSecure );
if( canSpawn )
{
if( m_RespawnTimer == null )
{
int mins = Utility.RandomMinMax( this.MinRespawnMinutes, this.MaxRespawnMinutes );
TimeSpan delay = TimeSpan.FromMinutes( mins );
m_NextRespawnTime = DateTime.Now + delay;
m_RespawnTimer = Timer.DelayCall( delay, new TimerCallback( Respawn ) );
}
}
else if( m_RespawnTimer != null )
{
m_RespawnTimer.Stop();
m_RespawnTimer = null;
}
}