diff options
author | Mattes D <github@xoft.cz> | 2014-05-18 22:30:34 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-05-18 22:30:34 +0200 |
commit | ac005681839134018f0162cfb8cb1453e11cbb46 (patch) | |
tree | 41cc966732262c0a8f5441932b758344856d6259 /src/Entities/Pickup.cpp | |
parent | Merge pull request #1005 from SphinxC0re/LoadPluginfolder (diff) | |
parent | Fixes (diff) | |
download | cuberite-ac005681839134018f0162cfb8cb1453e11cbb46.tar cuberite-ac005681839134018f0162cfb8cb1453e11cbb46.tar.gz cuberite-ac005681839134018f0162cfb8cb1453e11cbb46.tar.bz2 cuberite-ac005681839134018f0162cfb8cb1453e11cbb46.tar.lz cuberite-ac005681839134018f0162cfb8cb1453e11cbb46.tar.xz cuberite-ac005681839134018f0162cfb8cb1453e11cbb46.tar.zst cuberite-ac005681839134018f0162cfb8cb1453e11cbb46.zip |
Diffstat (limited to 'src/Entities/Pickup.cpp')
-rw-r--r-- | src/Entities/Pickup.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Entities/Pickup.cpp b/src/Entities/Pickup.cpp index 497b41683..0fd006485 100644 --- a/src/Entities/Pickup.cpp +++ b/src/Entities/Pickup.cpp @@ -192,6 +192,16 @@ bool cPickup::CollectedBy(cPlayer * a_Dest) int NumAdded = a_Dest->GetInventory().AddItem(m_Item); if (NumAdded > 0) { + // Check achievements + switch (m_Item.m_ItemType) + { + case E_BLOCK_LOG: a_Dest->AwardAchievement(achMineWood); break; + case E_ITEM_LEATHER: a_Dest->AwardAchievement(achKillCow); break; + case E_ITEM_DIAMOND: a_Dest->AwardAchievement(achDiamonds); break; + case E_ITEM_BLAZE_ROD: a_Dest->AwardAchievement(achBlazeRod); break; + default: break; + } + m_Item.m_ItemCount -= NumAdded; m_World->BroadcastCollectPickup(*this, *a_Dest); // Also send the "pop" sound effect with a somewhat random pitch (fast-random using EntityID ;) |