diff options
author | TheJumper <maximilian.springer@web.de> | 2014-02-23 18:13:49 +0100 |
---|---|---|
committer | TheJumper <maximilian.springer@web.de> | 2014-02-23 18:13:49 +0100 |
commit | 1afcc255bfe7153dc397970e0ece41d6d48e63be (patch) | |
tree | a6c3ea18af891781c4a7e48528e635def25ba98e /src/Mobs/Mooshroom.cpp | |
parent | Finally corrected the Enchantment constants. (diff) | |
download | cuberite-1afcc255bfe7153dc397970e0ece41d6d48e63be.tar cuberite-1afcc255bfe7153dc397970e0ece41d6d48e63be.tar.gz cuberite-1afcc255bfe7153dc397970e0ece41d6d48e63be.tar.bz2 cuberite-1afcc255bfe7153dc397970e0ece41d6d48e63be.tar.lz cuberite-1afcc255bfe7153dc397970e0ece41d6d48e63be.tar.xz cuberite-1afcc255bfe7153dc397970e0ece41d6d48e63be.tar.zst cuberite-1afcc255bfe7153dc397970e0ece41d6d48e63be.zip |
Diffstat (limited to 'src/Mobs/Mooshroom.cpp')
-rw-r--r-- | src/Mobs/Mooshroom.cpp | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/src/Mobs/Mooshroom.cpp b/src/Mobs/Mooshroom.cpp index 5873ec63f..8e4c52ae6 100644 --- a/src/Mobs/Mooshroom.cpp +++ b/src/Mobs/Mooshroom.cpp @@ -39,34 +39,35 @@ void cMooshroom::GetDrops(cItems & a_Drops, cEntity * a_Killer) void cMooshroom::OnRightClicked(cPlayer & a_Player) { - if ((a_Player.GetEquippedItem().m_ItemType == E_ITEM_BUCKET)) + switch (a_Player.GetEquippedItem().m_ItemType) { - if (!a_Player.IsGameModeCreative()) + case E_ITEM_BUCKET: { - a_Player.GetInventory().RemoveOneEquippedItem(); - a_Player.GetInventory().AddItem(E_ITEM_MILK); - } - } - - if ((a_Player.GetEquippedItem().m_ItemType == E_ITEM_BOWL)) - { - if (!a_Player.IsGameModeCreative()) + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + a_Player.GetInventory().AddItem(E_ITEM_MILK); + } + } break; + case E_ITEM_BOWL: { - a_Player.GetInventory().RemoveOneEquippedItem(); - a_Player.GetInventory().AddItem(E_ITEM_MUSHROOM_SOUP); - } - } - - if (a_Player.GetEquippedItem().m_ItemType == E_ITEM_SHEARS) - { - if (!a_Player.IsGameModeCreative()) + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + a_Player.GetInventory().AddItem(E_ITEM_MUSHROOM_SOUP); + } + } break; + case E_ITEM_SHEARS: { - a_Player.UseEquippedItem(); - } - - cItems Drops; - Drops.push_back(cItem(E_BLOCK_RED_MUSHROOM, 5, 0)); - m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10); + if (!a_Player.IsGameModeCreative()) + { + a_Player.UseEquippedItem(); + } + + cItems Drops; + Drops.push_back(cItem(E_BLOCK_RED_MUSHROOM, 5, 0)); + m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10); + } break; } } |