diff options
author | andrew <xdotftw@gmail.com> | 2014-05-12 16:05:09 +0200 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-05-12 16:05:09 +0200 |
commit | b3d2b5b2c94193fd9364b26293b7d96b748ff96d (patch) | |
tree | 215519ba96caea0269641209452661b8bd6e14da /src/Entities/Pickup.cpp | |
parent | Fixed compilation (diff) | |
download | cuberite-b3d2b5b2c94193fd9364b26293b7d96b748ff96d.tar cuberite-b3d2b5b2c94193fd9364b26293b7d96b748ff96d.tar.gz cuberite-b3d2b5b2c94193fd9364b26293b7d96b748ff96d.tar.bz2 cuberite-b3d2b5b2c94193fd9364b26293b7d96b748ff96d.tar.lz cuberite-b3d2b5b2c94193fd9364b26293b7d96b748ff96d.tar.xz cuberite-b3d2b5b2c94193fd9364b26293b7d96b748ff96d.tar.zst cuberite-b3d2b5b2c94193fd9364b26293b7d96b748ff96d.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 ;) |