chore(core/instance): Move to switch case (#16084)

This has just sloppy. Moved to Case switch with log error and else debug logging
This commit is contained in:
M'Dic
2023-04-27 19:31:09 -04:00
committed by GitHub
parent 3eae4c5713
commit 7b0efe01e5

View File

@@ -505,16 +505,26 @@ void InstanceScript::DoRespawnGameObject(ObjectGuid uiGuid, uint32 uiTimeToDespa
{
if (GameObject* go = instance->GetGameObject(uiGuid))
{
//not expect any of these should ever be handled
if (go->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE || go->GetGoType() == GAMEOBJECT_TYPE_DOOR ||
go->GetGoType() == GAMEOBJECT_TYPE_BUTTON || go->GetGoType() == GAMEOBJECT_TYPE_TRAP)
return;
switch (go->GetGoType())
{
case GAMEOBJECT_TYPE_DOOR:
case GAMEOBJECT_TYPE_BUTTON:
case GAMEOBJECT_TYPE_TRAP:
case GAMEOBJECT_TYPE_FISHINGNODE:
// not expect any of these should ever be handled
LOG_ERROR("scripts", "InstanceScript: DoRespawnGameObject can't respawn gameobject entry {}, because type is {}.", go->GetEntry(), go->GetGoType());
return;
default:
break;
}
if (go->isSpawned())
return;
go->SetRespawnTime(uiTimeToDespawn);
}
else
LOG_DEBUG("scripts", "InstanceScript: DoRespawnGameObject failed");
}
void InstanceScript::DoRespawnCreature(ObjectGuid guid, bool force)