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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user