summaryrefslogtreecommitdiffstats
path: root/source/Items/ItemSlab.h
diff options
context:
space:
mode:
authorluksor111@gmail.com <luksor111@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-12-27 16:07:12 +0100
committerluksor111@gmail.com <luksor111@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-12-27 16:07:12 +0100
commit69107bd54fb4b9dc273d16e4073e4861245d2331 (patch)
treeec1ee7e004ce4eaa48cfa5997d68b0b9f6619165 /source/Items/ItemSlab.h
parentFixed Linux compilation (diff)
downloadcuberite-69107bd54fb4b9dc273d16e4073e4861245d2331.tar
cuberite-69107bd54fb4b9dc273d16e4073e4861245d2331.tar.gz
cuberite-69107bd54fb4b9dc273d16e4073e4861245d2331.tar.bz2
cuberite-69107bd54fb4b9dc273d16e4073e4861245d2331.tar.lz
cuberite-69107bd54fb4b9dc273d16e4073e4861245d2331.tar.xz
cuberite-69107bd54fb4b9dc273d16e4073e4861245d2331.tar.zst
cuberite-69107bd54fb4b9dc273d16e4073e4861245d2331.zip
Diffstat (limited to 'source/Items/ItemSlab.h')
-rw-r--r--source/Items/ItemSlab.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/Items/ItemSlab.h b/source/Items/ItemSlab.h
index 36779138b..174beae22 100644
--- a/source/Items/ItemSlab.h
+++ b/source/Items/ItemSlab.h
@@ -29,12 +29,20 @@ public:
&& (Block == a_Item->m_ItemType) // Same slab
&& ((Meta & 0x7) == (a_Item->m_ItemHealth & 0x7))) // Same Texture
{
- cItem Item(a_Item->m_ItemType, 1);
- if (a_Player->GetInventory().RemoveItem(Item))
+ if(a_Player->GetGameMode() == eGameMode_Creative)
{
- a_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, Block - 1, Meta); // Block - 1 simple hack to save one if statement
+ a_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, Block - 1, Meta); // Block - 1 simple hack to save one if statement
return true;
}
+ else
+ {
+ cItem Item(a_Item->m_ItemType, 1);
+ if (a_Player->GetInventory().RemoveItem(Item))
+ {
+ a_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, Block - 1, Meta); // Block - 1 simple hack to save one if statement
+ return true;
+ }
+ }
}
return false;
}