Core/Maps: Prevent potential null dereference

Port From (https://github.com/TrinityCore/TrinityCore/commit/7a21d02da12667e6e873163de83fa3cb25d028aa)
This commit is contained in:
hondacrx
2021-01-19 13:28:00 -05:00
parent 9afb47f993
commit b5b43dc251
+1 -1
View File
@@ -2215,7 +2215,7 @@ namespace Game.Entities
}
uint thisRespawnTime = (uint)(forceDelay != 0 ? Time.UnixTime + forceDelay : m_respawnTime);
GetMap().SaveRespawnTime(SpawnObjectType.Creature, m_spawnId, GetEntry(), thisRespawnTime, GetMap().GetZoneId(GetPhaseShift(), GetHomePosition()), GridDefines.ComputeGridCoord(GetHomePosition().GetPositionX(), GetHomePosition().GetPositionY()).GetId(), m_creatureData.dbData && saveToDb);
GetMap().SaveRespawnTime(SpawnObjectType.Creature, m_spawnId, GetEntry(), thisRespawnTime, GetMap().GetZoneId(GetPhaseShift(), GetHomePosition()), GridDefines.ComputeGridCoord(GetHomePosition().GetPositionX(), GetHomePosition().GetPositionY()).GetId(), saveToDb && m_creatureData != null && m_creatureData.dbData);
}
public bool CanCreatureAttack(Unit victim, bool force = true)