diff options
| author | Dehravor <dehravor@gmail.com> | 2014-03-11 19:06:42 +0100 |
|---|---|---|
| committer | Dehravor <dehravor@gmail.com> | 2014-03-11 19:06:42 +0100 |
| commit | 892d9eac79e94796e3b22e5be368063d59b20efc (patch) | |
| tree | ca5ad782743f1c33a08bd6d61f0e2b81b1205e1b /src/server/game/Loot/LootMgr.cpp | |
| parent | 5221bd8c1099d0aa2c7317d9bf591fbe38c962c6 (diff) | |
Core/Loot: Fix master loot
Players will be able to open the loot window and see the items in case of master loot.
If the item is under threshold FFA applies, else the item becomes locked.
Also fix an exploit related to master loot item give.
Diffstat (limited to 'src/server/game/Loot/LootMgr.cpp')
| -rw-r--r-- | src/server/game/Loot/LootMgr.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index bb7f679b7cd..79056bcd750 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -953,6 +953,21 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) } break; } + case RESTRICTED_PERMISSION: + { + for (uint8 i = 0; i < l.items.size(); ++i) + { + if (!l.items[i].is_looted && !l.items[i].freeforall && l.items[i].conditions.empty() && l.items[i].AllowedForPlayer(lv.viewer)) + { + uint8 slot_type = l.items[i].is_blocked ? LOOT_SLOT_TYPE_LOCKED : LOOT_SLOT_TYPE_ALLOW_LOOT; + + b << uint8(i) << l.items[i]; + b << uint8(slot_type); + ++itemsShown; + } + } + break; + } default: return b; } @@ -977,6 +992,9 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) case MASTER_PERMISSION: b << uint8(LOOT_SLOT_TYPE_MASTER); break; + case RESTRICTED_PERMISSION: + b << (item.is_blocked ? uint8(LOOT_SLOT_TYPE_LOCKED) : uint8(slotType)); + break; case GROUP_PERMISSION: case ROUND_ROBIN_PERMISSION: if (!item.is_blocked) @@ -1033,6 +1051,9 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) case MASTER_PERMISSION: b << uint8(LOOT_SLOT_TYPE_MASTER); break; + case RESTRICTED_PERMISSION: + b << (item.is_blocked ? uint8(LOOT_SLOT_TYPE_LOCKED) : uint8(slotType)); + break; case GROUP_PERMISSION: case ROUND_ROBIN_PERMISSION: if (!item.is_blocked) |
