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:
@@ -2393,7 +2393,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
// if player is moving bags and is looting an item inside this bag
|
// if player is moving bags and is looting an item inside this bag
|
||||||
// release the loot
|
// release the loot
|
||||||
if (!GetLootGUID().IsEmpty())
|
if (!GetAELootView().Empty())
|
||||||
{
|
{
|
||||||
bool released = false;
|
bool released = false;
|
||||||
if (IsBagPos(src))
|
if (IsBagPos(src))
|
||||||
@@ -2404,9 +2404,9 @@ namespace Game.Entities
|
|||||||
Item bagItem = bag.GetItemByPos(i);
|
Item bagItem = bag.GetItemByPos(i);
|
||||||
if (bagItem != null)
|
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
|
released = true; // so we don't need to look at dstBag
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2422,9 +2422,9 @@ namespace Game.Entities
|
|||||||
Item bagItem = bag.GetItemByPos(i);
|
Item bagItem = bag.GetItemByPos(i);
|
||||||
if (bagItem != null)
|
if (bagItem != null)
|
||||||
{
|
{
|
||||||
if (bagItem.GetGUID() == GetLootGUID())
|
if (HasLootWorldObjectGUID(bagItem.GetGUID()))
|
||||||
{
|
{
|
||||||
GetSession().DoLootRelease(GetLootGUID());
|
GetSession().DoLootReleaseAll();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -756,9 +756,7 @@ namespace Game.Entities
|
|||||||
StopCastingBindSight();
|
StopCastingBindSight();
|
||||||
UnsummonPetTemporaryIfAny();
|
UnsummonPetTemporaryIfAny();
|
||||||
ClearComboPoints();
|
ClearComboPoints();
|
||||||
ObjectGuid lootGuid = GetLootGUID();
|
GetSession().DoLootReleaseAll();
|
||||||
if (!lootGuid.IsEmpty())
|
|
||||||
GetSession().DoLootRelease(lootGuid);
|
|
||||||
Global.OutdoorPvPMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId);
|
Global.OutdoorPvPMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId);
|
||||||
Global.BattleFieldMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId);
|
Global.BattleFieldMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -350,6 +350,7 @@ namespace Game
|
|||||||
player.SendLootRelease(lguid);
|
player.SendLootRelease(lguid);
|
||||||
player.RemoveAELootedWorldObject(lguid);
|
player.RemoveAELootedWorldObject(lguid);
|
||||||
|
|
||||||
|
if (player.GetAELootView().Empty())
|
||||||
player.RemoveUnitFlag(UnitFlags.Looting);
|
player.RemoveUnitFlag(UnitFlags.Looting);
|
||||||
|
|
||||||
if (!player.IsInWorld)
|
if (!player.IsInWorld)
|
||||||
|
|||||||
Reference in New Issue
Block a user