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

Port From (https://github.com/TrinityCore/TrinityCore/commit/924efc89b2668d390bf768ccd936cc67e4a77f5d)
This commit is contained in:
hondacrx
2024-02-06 16:00:34 -05:00
parent d42204efb3
commit 3ec159ebe1
+3 -1
View File
@@ -5565,7 +5565,9 @@ namespace Game.Entities
// SMSG_WORLD_SERVER_INFO
WorldServerInfo worldServerInfo = new();
worldServerInfo.InstanceGroupSize = GetMap().GetMapDifficulty().MaxPlayers; // @todo
var mapDifficulty = GetMap().GetMapDifficulty();
if (mapDifficulty != null)
worldServerInfo.InstanceGroupSize = mapDifficulty.MaxPlayers;
worldServerInfo.IsTournamentRealm = false; // @todo
worldServerInfo.RestrictedAccountMaxLevel = null; // @todo
worldServerInfo.RestrictedAccountMaxMoney = null; // @todo