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

Port From (https://github.com/TrinityCore/TrinityCore/commit/bfef73b5102201e85a31b39ae595da42d9750c7e)
This commit is contained in:
hondacrx
2021-12-22 20:32:04 -05:00
parent 97730e14ad
commit 8b23a77c5f
+2 -1
View File
@@ -6072,7 +6072,8 @@ namespace Game.Entities
// 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() == LootState.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() == LootState.Activated && !go.loot.IsLooted() && !go.GetMap().Instanceable() && go.GetLootGenerationTime() + go.GetRespawnDelay() < GameTime.GetGameTime())
go.SetLootState(LootState.Ready);
if (go.GetLootState() == LootState.Ready)