diff options
author | Wyrserth <wyrserth@protonmail.com> | 2019-06-28 19:27:42 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-13 00:42:18 +0100 |
commit | 2fea2a1e8104856587d0eff651eb2199dfcd0513 (patch) | |
tree | e4306bbe7b765f348e1d7e129a4b07aaae55db27 | |
parent | f136d3cfe0e92ac8578c631cc7c2c43086ba796f (diff) |
Core/GameObject: do not allow consumable chests to restock while partially looted.
(cherry picked from commit cd73664f53db3daad6c7e17edbcd0212ab383c0d)
-rw-r--r-- | src/server/game/Entities/GameObject/GameObject.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 9fc455bdf8e..11bdf7b759b 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -639,6 +639,7 @@ void GameObject::Update(uint32 diff) if (m_restockTime > GameTime::GetGameTime()) return; // If there is no restock timer, or if the restock timer passed, the chest becomes ready to loot + m_restockTime = 0; m_lootState = GO_READY; AddToObjectUpdateIfNeeded(); break; @@ -828,9 +829,10 @@ void GameObject::Update(uint32 diff) m_groupLootTimer -= diff; } - // Gameobject was partially looted and restock time passed, restock all loot now - if (GameTime::GetGameTime() >= m_restockTime) + // Non-consumable chest was partially looted and restock time passed, restock all loot now + if (GetGOInfo()->chest.consumable == 0 && GameTime::GetGameTime() >= m_restockTime) { + m_restockTime = 0; m_lootState = GO_READY; AddToObjectUpdateIfNeeded(); } |