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)) if (GameObject* go = instance->GetGameObject(uiGuid))
{ {
//not expect any of these should ever be handled switch (go->GetGoType())
if (go->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE || go->GetGoType() == GAMEOBJECT_TYPE_DOOR || {
go->GetGoType() == GAMEOBJECT_TYPE_BUTTON || go->GetGoType() == GAMEOBJECT_TYPE_TRAP) case GAMEOBJECT_TYPE_DOOR:
return; 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()) if (go->isSpawned())
return; return;
go->SetRespawnTime(uiTimeToDespawn); go->SetRespawnTime(uiTimeToDespawn);
} }
else
LOG_DEBUG("scripts", "InstanceScript: DoRespawnGameObject failed");
} }
void InstanceScript::DoRespawnCreature(ObjectGuid guid, bool force) void InstanceScript::DoRespawnCreature(ObjectGuid guid, bool force)