Core/Loot: don't allow to regenerate chest loot inside instances and raids. (#23449)

(cherry picked from commit 4320cd7d375927f1008824d6ddf8cc7d212d4ed2)
This commit is contained in:
Wyrserth
2021-12-11 16:18:41 +01:00
committed by Shauren
parent 20082ac65a
commit bfef73b510
+2 -1
View File
@@ -8796,7 +8796,8 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type, bool aeLooting/* = fa
// loot was generated and respawntime has passed since then, allow to recreate loot
// to avoid bugs, this rule covers spawned gameobjects only
if (go->isSpawnedByDefault() && go->getLootState() == GO_ACTIVATED && !go->loot.isLooted() && go->GetLootGenerationTime() + go->GetRespawnDelay() < GameTime::GetGameTime())
// Don't allow to regenerate chest loot inside instances and raids, to avoid exploits with duplicate boss loot being given for some encounters
if (go->isSpawnedByDefault() && go->getLootState() == GO_ACTIVATED && !go->loot.isLooted() && !go->GetMap()->Instanceable() && go->GetLootGenerationTime() + go->GetRespawnDelay() < GameTime::GetGameTime())
go->SetLootState(GO_READY);
if (go->getLootState() == GO_READY)