mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/GameObject: do not allow consumable chests to restock while partially looted.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user