From 5c411229169f81f80fad5b00fc4611ed4fcca611 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 24 Dec 2021 21:22:21 -0500 Subject: [PATCH] Core/GameObject: do not allow consumable chests to restock while partially looted. Port From (https://github.com/TrinityCore/TrinityCore/commit/2fea2a1e8104856587d0eff651eb2199dfcd0513) --- Source/Game/Entities/GameObject/GameObject.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Game/Entities/GameObject/GameObject.cs b/Source/Game/Entities/GameObject/GameObject.cs index 25ffa1d24..e25be58ed 100644 --- a/Source/Game/Entities/GameObject/GameObject.cs +++ b/Source/Game/Entities/GameObject/GameObject.cs @@ -538,6 +538,7 @@ namespace Game.Entities 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 = LootState.Ready; AddToObjectUpdateIfNeeded(); break; @@ -725,9 +726,10 @@ namespace Game.Entities 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 = LootState.Ready; AddToObjectUpdateIfNeeded(); }