Core/Players: Fixed a possible crash if a player is in an invalid zone

Thanks to the ones who commented in the commit that introduced the issue.
This commit is contained in:
Subv
2012-10-10 09:13:03 -05:00
parent e7a4a316c9
commit 595d194d99
+1 -1
View File
@@ -5524,7 +5524,7 @@ void Player::RepopAtGraveyard()
AreaTableEntry const* zone = GetAreaEntryByAreaID(GetAreaId());
// Such zones are considered unreachable as a ghost and the player must be automatically revived
if ((!isAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < zone->MaxDepth)
if ((!isAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < (zone ? zone->MaxDepth : -500.0f))
{
ResurrectPlayer(0.5f);
SpawnCorpseBones();