diff options
author | Wyrserth <wyrserth@protonmail.com> | 2019-06-28 19:27:42 +0200 |
---|---|---|
committer | Wyrserth <wyrserth@protonmail.com> | 2019-06-28 19:28:30 +0200 |
commit | cd73664f53db3daad6c7e17edbcd0212ab383c0d (patch) | |
tree | 90d4afb2dcdce991accbd375edae850f7d5d6e36 | |
parent | 9f0ac0c24376ec70b8227a8fb0a1e0e686cb3256 (diff) |
Core/GameObject: do not allow consumable chests to restock while partially looted.
-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 b04b0c7b9b4..04146d451a5 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -515,6 +515,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; @@ -703,9 +704,10 @@ void GameObject::Update(uint32 diff) else 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(); } |