diff options
author | Alexander Harkness <me@bearbin.net> | 2020-04-02 14:42:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-02 14:42:15 +0200 |
commit | cdc452916e3ec7e61f4a1ad822666192593b4b08 (patch) | |
tree | fcf35adfb6f907b7c2cd4388facc551cfe6c684a /src/Entities/Player.cpp | |
parent | Tweak attack ranges (diff) | |
download | cuberite-cdc452916e3ec7e61f4a1ad822666192593b4b08.tar cuberite-cdc452916e3ec7e61f4a1ad822666192593b4b08.tar.gz cuberite-cdc452916e3ec7e61f4a1ad822666192593b4b08.tar.bz2 cuberite-cdc452916e3ec7e61f4a1ad822666192593b4b08.tar.lz cuberite-cdc452916e3ec7e61f4a1ad822666192593b4b08.tar.xz cuberite-cdc452916e3ec7e61f4a1ad822666192593b4b08.tar.zst cuberite-cdc452916e3ec7e61f4a1ad822666192593b4b08.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/Player.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index b5d7f7c83..02cb7378d 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -1959,6 +1959,25 @@ void cPlayer::TossEquippedItem(char a_Amount) +void cPlayer::ReplaceOneEquippedItemTossRest(const cItem & a_Item) +{ + auto PlacedCount = GetInventory().ReplaceOneEquippedItem(a_Item); + char ItemCountToToss = a_Item.m_ItemCount - static_cast<char>(PlacedCount); + + if (ItemCountToToss == 0) + { + return; + } + + cItem Pickup = a_Item; + Pickup.m_ItemCount = ItemCountToToss; + TossPickup(Pickup); +} + + + + + void cPlayer::TossHeldItem(char a_Amount) { cItems Drops; |