mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user