From 7b0efe01e55f3f4aa9325472a98d4d2dbd803b58 Mon Sep 17 00:00:00 2001 From: M'Dic Date: Thu, 27 Apr 2023 19:31:09 -0400 Subject: [PATCH] chore(core/instance): Move to switch case (#16084) This has just sloppy. Moved to Case switch with log error and else debug logging --- src/server/game/Instances/InstanceScript.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index 3d013e302..993d7e905 100644 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -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)