summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemLighter.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-03-14 23:52:51 +0100
committerHowaner <franzi.moos@googlemail.com>2014-03-14 23:52:51 +0100
commitccc29c7c6c344b00e5b6c9236cf615b253b9a1b5 (patch)
tree990c8ee65902d303c9bdbe0b0ca98759843febae /src/Items/ItemLighter.h
parentChange tnt documentation to ticks (diff)
downloadcuberite-ccc29c7c6c344b00e5b6c9236cf615b253b9a1b5.tar
cuberite-ccc29c7c6c344b00e5b6c9236cf615b253b9a1b5.tar.gz
cuberite-ccc29c7c6c344b00e5b6c9236cf615b253b9a1b5.tar.bz2
cuberite-ccc29c7c6c344b00e5b6c9236cf615b253b9a1b5.tar.lz
cuberite-ccc29c7c6c344b00e5b6c9236cf615b253b9a1b5.tar.xz
cuberite-ccc29c7c6c344b00e5b6c9236cf615b253b9a1b5.tar.zst
cuberite-ccc29c7c6c344b00e5b6c9236cf615b253b9a1b5.zip
Diffstat (limited to '')
-rw-r--r--src/Items/ItemLighter.h22
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;
}
}