diff options
author | jackpoz <giacomopoz@gmail.com> | 2015-05-17 14:50:30 +0200 |
---|---|---|
committer | jackpoz <giacomopoz@gmail.com> | 2015-05-17 14:50:30 +0200 |
commit | b5cc8c5b17c96f281728ee08576acfff507d8039 (patch) | |
tree | 62cbec365fccd246e704e5d7370bf35989ce1a95 /src/server/game/Instances/InstanceScript.cpp | |
parent | 9842bb96d27edb9a6dea5ed49a300897953c73bc (diff) |
Scripts/ToC: Fix doors opening/closing during Dreadscale fight
Fix doors opening/closing during Dreadscale fight by sending a CloseDoor command instead of toggling the door state when Dreadscale resets its movement.
Note that bounding the door state to boss movement makes poor sense and should be changed. Other bosses in ToC have this logic and should be updated if they show the same bug.
Diffstat (limited to 'src/server/game/Instances/InstanceScript.cpp')
-rw-r--r-- | src/server/game/Instances/InstanceScript.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index 42bf61b6e38..da806e5b038 100644 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -426,7 +426,26 @@ void InstanceScript::DoUseDoorOrButton(ObjectGuid guid, uint32 withRestoreTime / TC_LOG_ERROR("scripts", "InstanceScript: DoUseDoorOrButton can't use gameobject entry %u, because type is %u.", go->GetEntry(), go->GetGoType()); } else - TC_LOG_DEBUG("scripts", "InstanceScript: HandleGameObject failed"); + TC_LOG_DEBUG("scripts", "InstanceScript: DoUseDoorOrButton failed"); +} + +void InstanceScript::DoCloseDoorOrButton(ObjectGuid guid) +{ + if (!guid) + return; + + if (GameObject* go = instance->GetGameObject(guid)) + { + if (go->GetGoType() == GAMEOBJECT_TYPE_DOOR || go->GetGoType() == GAMEOBJECT_TYPE_BUTTON) + { + if (go->getLootState() == GO_ACTIVATED) + go->ResetDoorOrButton(); + } + else + TC_LOG_ERROR("scripts", "InstanceScript: DoCloseDoorOrButton can't use gameobject entry %u, because type is %u.", go->GetEntry(), go->GetGoType()); + } + else + TC_LOG_DEBUG("scripts", "InstanceScript: DoCloseDoorOrButton failed"); } void InstanceScript::DoRespawnGameObject(ObjectGuid guid, uint32 timeToDespawn /*= MINUTE*/) |