diff options
| author | robinsch <robinsch@users.noreply.github.com> | 2021-08-09 14:47:35 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-03-12 14:36:31 +0100 |
| commit | 5f38fd2f2d4fc2f7caba8c6b9e0b3286d8d79339 (patch) | |
| tree | fa8c8c03827df834493dafaac3857d847afa2bc2 /src/server | |
| parent | ca472c1871d0c9380fb2755052d7460e33a39727 (diff) | |
Core/Item: Fixed another possible container exploit due to invalid loading of stored loot items in DB (#26795)
(cherry picked from commit 1b9ee9525316861dd1d2099ed355a221ffc47e3b)
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/game/Loot/LootItemStorage.cpp | 3 | ||||
| -rw-r--r-- | src/server/game/Loot/LootItemStorage.h | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/server/game/Loot/LootItemStorage.cpp b/src/server/game/Loot/LootItemStorage.cpp index 7153f1179f8..476f80d4e09 100644 --- a/src/server/game/Loot/LootItemStorage.cpp +++ b/src/server/game/Loot/LootItemStorage.cpp @@ -32,7 +32,7 @@ namespace std::unordered_map<uint64, StoredLootContainer> _lootItemStore; } -StoredLootItem::StoredLootItem(LootItem const& lootItem) : ItemId(lootItem.itemid), Count(lootItem.count), FollowRules(lootItem.follow_loot_rules), +StoredLootItem::StoredLootItem(LootItem const& lootItem) : ItemId(lootItem.itemid), Count(lootItem.count), ItemIndex(lootItem.itemIndex), FollowRules(lootItem.follow_loot_rules), FFA(lootItem.freeforall), Blocked(lootItem.is_blocked), Counted(lootItem.is_counted), UnderThreshold(lootItem.is_underthreshold), NeedsQuest(lootItem.needs_quest), RandomBonusListId(lootItem.randomBonusListId), Context(lootItem.context), BonusListIDs(lootItem.BonusListIDs) { @@ -160,6 +160,7 @@ bool LootItemStorage::LoadStoredLoot(Item* item, Player* player) LootItem li; li.itemid = storedItemPair.first; li.count = storedItemPair.second.Count; + li.itemIndex = storedItemPair.second.ItemIndex; li.follow_loot_rules = storedItemPair.second.FollowRules; li.freeforall = storedItemPair.second.FFA; li.is_blocked = storedItemPair.second.Blocked; diff --git a/src/server/game/Loot/LootItemStorage.h b/src/server/game/Loot/LootItemStorage.h index 16ae71e415f..a696e43d475 100644 --- a/src/server/game/Loot/LootItemStorage.h +++ b/src/server/game/Loot/LootItemStorage.h @@ -38,6 +38,7 @@ struct StoredLootItem uint32 ItemId; uint32 Count; + uint32 ItemIndex; bool FollowRules; bool FFA; bool Blocked; |
