Core/Players: fixed a possible crash in SendInitialPacketsBeforeAddToMap when uninstanced maps don't have a valid MapDifficulty entry

(cherry picked from commit 924efc89b2)
This commit is contained in:
Ovahlord
2024-01-29 16:43:55 +01:00
committed by funjoker
parent 2db09c3fe7
commit 9699c18653

View File

@@ -23482,7 +23482,8 @@ void Player::SendInitialPacketsBeforeAddToMap()
/// SMSG_WORLD_SERVER_INFO
WorldPackets::Misc::WorldServerInfo worldServerInfo;
worldServerInfo.InstanceGroupSize = GetMap()->GetMapDifficulty()->MaxPlayers;
if (MapDifficultyEntry const* mapDifficulty = GetMap()->GetMapDifficulty())
worldServerInfo.InstanceGroupSize = mapDifficulty->MaxPlayers;
worldServerInfo.IsTournamentRealm = 0; /// @todo
// worldServerInfo.RestrictedAccountMaxLevel; /// @todo
// worldServerInfo.RestrictedAccountMaxMoney; /// @todo