Core/GameObject: do not allow consumable chests to restock while partially looted.
Port From (https://github.com/TrinityCore/TrinityCore/commit/2fea2a1e8104856587d0eff651eb2199dfcd0513)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user