diff options
author | Mattes D <github@xoft.cz> | 2014-03-16 21:43:33 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-03-16 21:43:33 +0100 |
commit | dc77cbfdc47016e0cb2a5ba9e4b18a1cb6896805 (patch) | |
tree | 0b599b418d62011ddc5f6ebb2702d7c4f6e1567e /src/Items/ItemLighter.h | |
parent | Wrong if in BlockLeaves (diff) | |
parent | Fix anvil pickups. (diff) | |
download | cuberite-dc77cbfdc47016e0cb2a5ba9e4b18a1cb6896805.tar cuberite-dc77cbfdc47016e0cb2a5ba9e4b18a1cb6896805.tar.gz cuberite-dc77cbfdc47016e0cb2a5ba9e4b18a1cb6896805.tar.bz2 cuberite-dc77cbfdc47016e0cb2a5ba9e4b18a1cb6896805.tar.lz cuberite-dc77cbfdc47016e0cb2a5ba9e4b18a1cb6896805.tar.xz cuberite-dc77cbfdc47016e0cb2a5ba9e4b18a1cb6896805.tar.zst cuberite-dc77cbfdc47016e0cb2a5ba9e4b18a1cb6896805.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Items/ItemLighter.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/Items/ItemLighter.h b/src/Items/ItemLighter.h index 18873e911..2db6c829a 100644 --- a/src/Items/ItemLighter.h +++ b/src/Items/ItemLighter.h @@ -26,7 +26,26 @@ public: return false; } - a_Player->UseEquippedItem(); + if (!a_Player->IsGameModeCreative()) + { + switch (m_ItemType) + { + case E_ITEM_FLINT_AND_STEEL: + { + a_Player->UseEquippedItem(); + break; + } + case E_ITEM_FIRE_CHARGE: + { + a_Player->GetInventory().RemoveOneEquippedItem(); + break; + } + default: + { + ASSERT(!"Unknown Lighter Item!"); + } + } + } switch (a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ)) { @@ -49,6 +68,7 @@ public: if (a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ) == E_BLOCK_AIR) { a_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_FIRE, 0); + a_World->BroadcastSoundEffect("fire.ignite", a_BlockX * 8, a_BlockY * 8, a_BlockZ * 8, 1.0F, 1.04F); break; } } |