mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 07:48:02 +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))
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user