diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-05-24 13:44:49 +0200 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-05-24 13:44:49 +0200 |
commit | 4ab82881165cb180b020e67f851028718ab84d87 (patch) | |
tree | 93e773ebd46fb76dd520821133b01f6d99b26e94 /src/Entities/Pickup.cpp | |
parent | Ignore CTest files (diff) | |
parent | Merge pull request #1022 from mc-server/FixMineshafts (diff) | |
download | cuberite-4ab82881165cb180b020e67f851028718ab84d87.tar cuberite-4ab82881165cb180b020e67f851028718ab84d87.tar.gz cuberite-4ab82881165cb180b020e67f851028718ab84d87.tar.bz2 cuberite-4ab82881165cb180b020e67f851028718ab84d87.tar.lz cuberite-4ab82881165cb180b020e67f851028718ab84d87.tar.xz cuberite-4ab82881165cb180b020e67f851028718ab84d87.tar.zst cuberite-4ab82881165cb180b020e67f851028718ab84d87.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 ;) |