summaryrefslogtreecommitdiffstats
path: root/src/Entities/Pickup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Entities/Pickup.cpp')
-rw-r--r--src/Entities/Pickup.cpp10
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 ;)