mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
REPO: Code-style clean-ups
* Fixed pMap->map * Fixed pInstance->instance * Fixed pInsta->instance * Fixed pQuest->quest * Fixed pWho->who * Fixed pTarget->target * Fixed pGo->go ~DEVNOTES: Handlers/QuestHandler.cpp still needs to be cleaned...
This commit is contained in:
@@ -253,35 +253,35 @@ void InstanceScript::DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime,
|
||||
if (!uiGuid)
|
||||
return;
|
||||
|
||||
GameObject* pGo = instance->GetGameObject(uiGuid);
|
||||
GameObject* go = instance->GetGameObject(uiGuid);
|
||||
|
||||
if (pGo)
|
||||
if (go)
|
||||
{
|
||||
if (pGo->GetGoType() == GAMEOBJECT_TYPE_DOOR || pGo->GetGoType() == GAMEOBJECT_TYPE_BUTTON)
|
||||
if (go->GetGoType() == GAMEOBJECT_TYPE_DOOR || go->GetGoType() == GAMEOBJECT_TYPE_BUTTON)
|
||||
{
|
||||
if (pGo->getLootState() == GO_READY)
|
||||
pGo->UseDoorOrButton(uiWithRestoreTime, bUseAlternativeState);
|
||||
else if (pGo->getLootState() == GO_ACTIVATED)
|
||||
pGo->ResetDoorOrButton();
|
||||
if (go->getLootState() == GO_READY)
|
||||
go->UseDoorOrButton(uiWithRestoreTime, bUseAlternativeState);
|
||||
else if (go->getLootState() == GO_ACTIVATED)
|
||||
go->ResetDoorOrButton();
|
||||
}
|
||||
else
|
||||
sLog->outError("SD2: Script call DoUseDoorOrButton, but gameobject entry %u is type %u.", pGo->GetEntry(), pGo->GetGoType());
|
||||
sLog->outError("SD2: Script call DoUseDoorOrButton, but gameobject entry %u is type %u.", go->GetEntry(), go->GetGoType());
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceScript::DoRespawnGameObject(uint64 uiGuid, uint32 uiTimeToDespawn)
|
||||
{
|
||||
if (GameObject* pGo = instance->GetGameObject(uiGuid))
|
||||
if (GameObject* go = instance->GetGameObject(uiGuid))
|
||||
{
|
||||
//not expect any of these should ever be handled
|
||||
if (pGo->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE || pGo->GetGoType() == GAMEOBJECT_TYPE_DOOR ||
|
||||
pGo->GetGoType() == GAMEOBJECT_TYPE_BUTTON || pGo->GetGoType() == GAMEOBJECT_TYPE_TRAP)
|
||||
if (go->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE || go->GetGoType() == GAMEOBJECT_TYPE_DOOR ||
|
||||
go->GetGoType() == GAMEOBJECT_TYPE_BUTTON || go->GetGoType() == GAMEOBJECT_TYPE_TRAP)
|
||||
return;
|
||||
|
||||
if (pGo->isSpawned())
|
||||
if (go->isSpawned())
|
||||
return;
|
||||
|
||||
pGo->SetRespawnTime(uiTimeToDespawn);
|
||||
go->SetRespawnTime(uiTimeToDespawn);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user