Core/Loot: Set loot dungeon encounter id before generating

Port From (https://github.com/TrinityCore/TrinityCore/commit/5f1a4cf9044d9ad65b49eb859ec36e1f62c2be10)
This commit is contained in:
hondacrx
2022-10-05 16:21:19 -04:00
parent 023fc60699
commit 86fa768ef3
4 changed files with 23 additions and 16 deletions
+1 -2
View File
@@ -1259,6 +1259,7 @@ namespace Game.Spells
loot = new(gameObjTarget.GetMap(), guid, loottype, groupRules ? group : null);
gameObjTarget.loot = loot;
loot.SetDungeonEncounterId(gameObjTarget.GetGoInfo().Chest.DungeonEncounter);
loot.FillLoot(lootId, LootStorage.Gameobject, player, !groupRules, false, gameObjTarget.GetLootMode(), gameObjTarget.GetMap().GetDifficultyLootItemContext());
if (gameObjTarget.GetLootMode() > 0)
@@ -1267,8 +1268,6 @@ namespace Game.Spells
if (addon != null)
loot.GenerateMoneyLoot(addon.Mingold, addon.Maxgold);
}
loot.SetDungeonEncounterId(gameObjTarget.GetGoInfo().Chest.DungeonEncounter);
}
/// @todo possible must be moved to loot release (in different from linked triggering)