aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWyrserth <43747507+Wyrserth@users.noreply.github.com>2019-06-14 15:06:39 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-11 12:03:31 +0100
commit81a8366ce5659f3556a0b910a0437256d95b62f9 (patch)
tree31a2c43bf381b9f5923a219d9dc1c71dda666e2f /src
parent2d0775b86d60d309a63ead712e1eae84bb1b502f (diff)
Core/Player: allow AutoStoreLoot to specify if the looted item should be shown as if created by the player. (#23400)
(cherry picked from commit 8d53d16d162689f6034acf963406c7188f4a7f79)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp4
-rw-r--r--src/server/game/Entities/Player/Player.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 413bea41cac..2e4672d1291 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -26364,7 +26364,7 @@ void Player::InitRunes()
SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::PowerRegenInterruptedFlatModifier, runeIndex), 0.0f);
}
-void Player::AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store, ItemContext context, bool broadcast)
+void Player::AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store, ItemContext context, bool broadcast, bool createdByPlayer)
{
Loot loot;
loot.FillLoot (loot_id, store, this, true, false, LOOT_MODE_DEFAULT, context);
@@ -26387,7 +26387,7 @@ void Player::AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore cons
}
Item* pItem = StoreNewItem(dest, lootItem->itemid, true, lootItem->randomBonusListId, GuidSet(), lootItem->context, lootItem->BonusListIDs);
- SendNewItem(pItem, lootItem->count, false, false, broadcast);
+ SendNewItem(pItem, lootItem->count, false, createdByPlayer, broadcast);
}
}
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index f12bdd3141c..fc13fc16798 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1363,8 +1363,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
void EquipChildItem(uint8 parentBag, uint8 parentSlot, Item* parentItem);
void AutoUnequipChildItem(Item* parentItem);
bool StoreNewItemInBestSlots(uint32 item_id, uint32 item_count);
- void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store, ItemContext context = ItemContext::NONE, bool broadcast = false);
- void AutoStoreLoot(uint32 loot_id, LootStore const& store, ItemContext context = ItemContext::NONE, bool broadcast = false) { AutoStoreLoot(NULL_BAG, NULL_SLOT, loot_id, store, context, broadcast); }
+ void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store, ItemContext context = ItemContext::NONE, bool broadcast = false, bool createdByPlayer = false);
+ void AutoStoreLoot(uint32 loot_id, LootStore const& store, ItemContext context = ItemContext::NONE, bool broadcast = false, bool createdByPlayer = false) { AutoStoreLoot(NULL_BAG, NULL_SLOT, loot_id, store, context, broadcast, createdByPlayer); }
void StoreLootItem(uint8 lootSlot, Loot* loot, AELootResult* aeResult = nullptr);
InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = nullptr, uint32* offendingItemId = nullptr) const;