Core/Loot: Corrected loot release logic on leaving world and swapping bags

Port From (https://github.com/TrinityCore/TrinityCore/commit/30ad7e3337f8da32cb567489f4203c7eb35d17a4)
This commit is contained in:
hondacrx
2022-09-18 15:05:23 -04:00
parent 597772b3ce
commit 1f01e15e09
3 changed files with 8 additions and 9 deletions
+5 -5
View File
@@ -2393,7 +2393,7 @@ namespace Game.Entities
// if player is moving bags and is looting an item inside this bag
// release the loot
if (!GetLootGUID().IsEmpty())
if (!GetAELootView().Empty())
{
bool released = false;
if (IsBagPos(src))
@@ -2404,9 +2404,9 @@ namespace Game.Entities
Item bagItem = bag.GetItemByPos(i);
if (bagItem != null)
{
if (bagItem.GetGUID() == GetLootGUID())
if (HasLootWorldObjectGUID(bagItem.GetGUID()))
{
GetSession().DoLootRelease(GetLootGUID());
GetSession().DoLootReleaseAll();
released = true; // so we don't need to look at dstBag
break;
}
@@ -2422,9 +2422,9 @@ namespace Game.Entities
Item bagItem = bag.GetItemByPos(i);
if (bagItem != null)
{
if (bagItem.GetGUID() == GetLootGUID())
if (HasLootWorldObjectGUID(bagItem.GetGUID()))
{
GetSession().DoLootRelease(GetLootGUID());
GetSession().DoLootReleaseAll();
break;
}
}