Core/Groups: Fixed crash in loot rolls happening when looted object despawns before roll expires

Port From (https://github.com/TrinityCore/TrinityCore/commit/6f8d6f5c9bc32bbe11de3377501453da1106f98a)
This commit is contained in:
hondacrx
2022-02-25 14:21:19 -05:00
parent 63be1f8dd5
commit bbcebe5790
+2 -1
View File
@@ -2605,8 +2605,9 @@ namespace Game.Groups
Roll GetRoll(ObjectGuid lootObjectGuid, byte lootListId)
{
foreach (var roll in RollId)
if (roll.GetTarget() != null && roll.GetTarget().GetGUID() == lootObjectGuid && roll.itemSlot == lootListId && roll.IsValid())
if (roll.IsValid() && roll.GetTarget().GetGUID() == lootObjectGuid && roll.itemSlot == lootListId)
return roll;
return null;
}