Core/Battleground: Attempt to fix a crash

Please report this error if you get it
This commit is contained in:
jackpoz
2020-04-04 19:50:53 +02:00
parent 5d70f6ccd4
commit d1f9cf84a5

View File

@@ -1603,6 +1603,12 @@ void Battleground::EndNow()
// buffs are in their positions when battleground starts
void Battleground::HandleTriggerBuff(ObjectGuid go_guid)
{
if (!FindBgMap())
{
TC_LOG_ERROR("bg.battleground", "Battleground::HandleTriggerBuff called with null bg map, %s", go_guid.ToString().c_str());
return;
}
GameObject* obj = GetBgMap()->GetGameObject(go_guid);
if (!obj || obj->GetGoType() != GAMEOBJECT_TYPE_TRAP || !obj->isSpawned())
return;