aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Loot
diff options
context:
space:
mode:
authorxinef1 <w.szyszko2@gmail.com>2017-02-04 14:58:50 +0100
committerShauren <shauren.trinity@gmail.com>2018-12-09 14:18:42 +0100
commit8725eec9c1c15f3e76bd9d524d4a5d8d0b3f0a44 (patch)
treee1938effb423e328f36e7da336c91aed73e5c6f1 /src/server/game/Loot
parentfef8e5fe14aa5797b859b2b294386c984ed674b2 (diff)
Core/Loot: Only allow the roll winner to loot the item he won in case it cannot be added to inventory instantly (full or any other reason) (#19037)7.3.5/26972
(cherry-picked from ab6ac42bf032b723167c37caed875c76a1295ec6)
Diffstat (limited to 'src/server/game/Loot')
-rw-r--r--src/server/game/Loot/Loot.cpp8
-rw-r--r--src/server/game/Loot/Loot.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/server/game/Loot/Loot.cpp b/src/server/game/Loot/Loot.cpp
index 681f441ea84..e9a4e0c4757 100644
--- a/src/server/game/Loot/Loot.cpp
+++ b/src/server/game/Loot/Loot.cpp
@@ -55,6 +55,7 @@ LootItem::LootItem(LootStoreItem const& li)
is_blocked = 0;
is_underthreshold = 0;
is_counted = 0;
+ rollWinnerGUID = ObjectGuid::Empty;
canSave = true;
}
@@ -518,6 +519,13 @@ void Loot::BuildLootResponse(WorldPackets::Loot::LootResponse& packet, Player* v
// => item is lootable
slot_type = LOOT_SLOT_TYPE_ALLOW_LOOT;
}
+ else if (!items[i].rollWinnerGUID.IsEmpty())
+ {
+ if (items[i].rollWinnerGUID == viewer->GetGUID())
+ slot_type = LOOT_SLOT_TYPE_OWNER;
+ else
+ continue;
+ }
else
// item shall not be displayed.
continue;
diff --git a/src/server/game/Loot/Loot.h b/src/server/game/Loot/Loot.h
index a2c30e42a0c..f9da5537806 100644
--- a/src/server/game/Loot/Loot.h
+++ b/src/server/game/Loot/Loot.h
@@ -140,6 +140,7 @@ struct TC_GAME_API LootItem
uint8 context;
ConditionContainer conditions; // additional loot condition
GuidSet allowedGUIDs;
+ ObjectGuid rollWinnerGUID; // Stores the guid of person who won loot, if his bags are full only he can see the item in loot list!
uint8 count : 8;
bool is_looted : 1;
bool is_blocked : 1;