diff options
author | sebi.noreply@gmail.com <sebi.noreply@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-10-24 14:48:25 +0200 |
---|---|---|
committer | sebi.noreply@gmail.com <sebi.noreply@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-10-24 14:48:25 +0200 |
commit | e33e9111abe5bb7968f48bd2801bf182754e554c (patch) | |
tree | eece777a96e41238cbe1ecb6e569aa81d94905d2 /source/Pickup.cpp | |
parent | #grammarnazi: fixed tabs to spaces and alpha-sort (diff) | |
download | cuberite-e33e9111abe5bb7968f48bd2801bf182754e554c.tar cuberite-e33e9111abe5bb7968f48bd2801bf182754e554c.tar.gz cuberite-e33e9111abe5bb7968f48bd2801bf182754e554c.tar.bz2 cuberite-e33e9111abe5bb7968f48bd2801bf182754e554c.tar.lz cuberite-e33e9111abe5bb7968f48bd2801bf182754e554c.tar.xz cuberite-e33e9111abe5bb7968f48bd2801bf182754e554c.tar.zst cuberite-e33e9111abe5bb7968f48bd2801bf182754e554c.zip |
Diffstat (limited to 'source/Pickup.cpp')
-rw-r--r-- | source/Pickup.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/Pickup.cpp b/source/Pickup.cpp index ea1f603a4..7ea730708 100644 --- a/source/Pickup.cpp +++ b/source/Pickup.cpp @@ -256,12 +256,16 @@ bool cPickup::CollectedBy( cPlayer* a_Dest ) return false; } - if (a_Dest->GetInventory().AddItem(*m_Item)) + if (a_Dest->GetInventory().AddItemAnyAmount(*m_Item)) { m_World->BroadcastCollectPickup(*this, *a_Dest); - m_bCollected = true; m_Timer = 0; + if( m_Item->m_ItemCount != 0 ) { + cItems Pickup; + Pickup.push_back(cItem(*m_Item)); + m_World->SpawnItemPickups(Pickup, m_Pos.x, m_Pos.y, m_Pos.z); + } return true; } |