From bbcebe5790129bd273967a645b80c29df363c4de Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 25 Feb 2022 14:21:19 -0500 Subject: [PATCH] Core/Groups: Fixed crash in loot rolls happening when looted object despawns before roll expires Port From (https://github.com/TrinityCore/TrinityCore/commit/6f8d6f5c9bc32bbe11de3377501453da1106f98a) --- Source/Game/Groups/Group.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Game/Groups/Group.cs b/Source/Game/Groups/Group.cs index f11e5f3e3..f55087476 100644 --- a/Source/Game/Groups/Group.cs +++ b/Source/Game/Groups/Group.cs @@ -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; }