diff --git a/src/game/Entities/Creature.cpp b/src/game/Entities/Creature.cpp index 2751bdf639..8d0fabf000 100644 --- a/src/game/Entities/Creature.cpp +++ b/src/game/Entities/Creature.cpp @@ -900,7 +900,17 @@ bool Creature::Create(uint32 dbGuid, uint32 guidlow, CreatureCreatePos& cPos, Cr // Notify the pvp script if (GetMap()->IsBattleGround()) - static_cast(GetMap())->GetBG()->HandleCreatureCreate(this); + { + BattleGround* bg = static_cast(GetMap())->GetBG(); + if (bg) + { + bg->HandleCreatureCreate(this); + } + else + { + return false; + } + } else if (OutdoorPvP* outdoorPvP = sOutdoorPvPMgr.GetScript(GetZoneId())) outdoorPvP->HandleCreatureCreate(this); diff --git a/src/game/Entities/GameObject.cpp b/src/game/Entities/GameObject.cpp index d260d7008c..391f9703c5 100644 --- a/src/game/Entities/GameObject.cpp +++ b/src/game/Entities/GameObject.cpp @@ -291,7 +291,17 @@ bool GameObject::Create(uint32 dbGuid, uint32 guidlow, uint32 name_id, Map* map, // Notify the battleground or outdoor pvp script if (map->IsBattleGround()) - ((BattleGroundMap*)map)->GetBG()->HandleGameObjectCreate(this); + { + BattleGround* bg = static_cast(GetMap())->GetBG(); + if (bg) + { + bg->HandleGameObjectCreate(this); + } + else + { + return false; + } + } else if (OutdoorPvP* outdoorPvP = sOutdoorPvPMgr.GetScript(GetZoneId())) outdoorPvP->HandleGameObjectCreate(this);