From a39adadd0fb59fa9ac609c260fa935de5098a405 Mon Sep 17 00:00:00 2001 From: "lapayo94@gmail.com" Date: Thu, 23 Aug 2012 20:41:48 +0000 Subject: Fixed Bug #237 Sign placement git-svn-id: http://mc-server.googlecode.com/svn/trunk@781 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/items/Item.cpp | 4 ++++ source/items/ItemSign.h | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 source/items/ItemSign.h (limited to 'source') diff --git a/source/items/Item.cpp b/source/items/Item.cpp index b645a8a93..17f4ead71 100644 --- a/source/items/Item.cpp +++ b/source/items/Item.cpp @@ -25,6 +25,7 @@ #include "ItemSword.h" #include "ItemDoor.h" #include "ItemFood.h" +#include "ItemSign.h" #include "../blocks/Block.h" @@ -162,6 +163,9 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemID) { return new cItemFoodHandler(a_ItemID); } + + case E_ITEM_SIGN: + return new cItemSignHandler(a_ItemID); } } diff --git a/source/items/ItemSign.h b/source/items/ItemSign.h new file mode 100644 index 000000000..06116f0e8 --- /dev/null +++ b/source/items/ItemSign.h @@ -0,0 +1,25 @@ +#pragma once + +#include "Item.h" +#include "../cWorld.h" + +class cItemSignHandler : public cItemHandler +{ +public: + cItemSignHandler(int a_ItemID) + : cItemHandler(a_ItemID) + { + + } + + virtual bool IsPlaceable() override + { + return true; + } + + virtual BLOCKTYPE GetBlockType() override + { + return E_BLOCK_SIGN_POST; + } + +}; \ No newline at end of file -- cgit v1.2.3