From 69107bd54fb4b9dc273d16e4073e4861245d2331 Mon Sep 17 00:00:00 2001 From: "luksor111@gmail.com" Date: Thu, 27 Dec 2012 15:07:12 +0000 Subject: Fixed slab usage in creative mode git-svn-id: http://mc-server.googlecode.com/svn/trunk@1112 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Items/ItemSlab.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'source/Items') 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; } -- cgit v1.2.3