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())
|
if (m_restockTime > GameTime.GetGameTime())
|
||||||
return;
|
return;
|
||||||
// If there is no restock timer, or if the restock timer passed, the chest becomes ready to loot
|
// 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;
|
m_lootState = LootState.Ready;
|
||||||
AddToObjectUpdateIfNeeded();
|
AddToObjectUpdateIfNeeded();
|
||||||
break;
|
break;
|
||||||
@@ -725,9 +726,10 @@ namespace Game.Entities
|
|||||||
m_groupLootTimer -= diff;
|
m_groupLootTimer -= diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gameobject was partially looted and restock time passed, restock all loot now
|
// Non-consumable chest was partially looted and restock time passed, restock all loot now
|
||||||
if (GameTime.GetGameTime() >= m_restockTime)
|
if (GetGoInfo().Chest.consumable == 0 && GameTime.GetGameTime() >= m_restockTime)
|
||||||
{
|
{
|
||||||
|
m_restockTime = 0;
|
||||||
m_lootState = LootState.Ready;
|
m_lootState = LootState.Ready;
|
||||||
AddToObjectUpdateIfNeeded();
|
AddToObjectUpdateIfNeeded();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user