Core/Battlefield: Fixed startup crash when compiled without scripts
Port From (https://github.com/TrinityCore/TrinityCore/commit/c5d3bd2cdd8f5ccf0d458fd9a97f315d87c1113a)
This commit is contained in:
@@ -469,7 +469,7 @@ namespace Game.BattleFields
|
|||||||
Global.CreatureTextMgr.SendChat(stalker, (byte)id, target);
|
Global.CreatureTextMgr.SendChat(stalker, (byte)id, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendInitWorldStatesTo(Player player)
|
public void SendInitWorldStatesTo(Player player)
|
||||||
{
|
{
|
||||||
InitWorldStates packet = new();
|
InitWorldStates packet = new();
|
||||||
packet.MapID = m_MapId;
|
packet.MapID = m_MapId;
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ namespace Game.BattleFields
|
|||||||
uint scriptId = Global.ObjectMgr.GetScriptId(result.Read<string>(1));
|
uint scriptId = Global.ObjectMgr.GetScriptId(result.Read<string>(1));
|
||||||
|
|
||||||
var bf = Global.ScriptMgr.CreateBattlefield(scriptId);
|
var bf = Global.ScriptMgr.CreateBattlefield(scriptId);
|
||||||
|
if (bf == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (!bf.SetupBattlefield())
|
if (!bf.SetupBattlefield())
|
||||||
{
|
{
|
||||||
Log.outInfo(LogFilter.Battlefield, $"Setting up battlefield with TypeId {typeId} failed.");
|
Log.outInfo(LogFilter.Battlefield, $"Setting up battlefield with TypeId {typeId} failed.");
|
||||||
|
|||||||
Reference in New Issue
Block a user