From f419ec2fe783ddf4252f50f475c2a5cf9e70038e Mon Sep 17 00:00:00 2001 From: "lapayo94@gmail.com" Date: Sun, 25 Dec 2011 01:40:31 +0000 Subject: - improved and simplified the door system (shorter, clearer) - Doors now drop a complete door & other part gets destroyed - Build a function for pickup counts (cBlockToPickup::PickupCount) (Default is 1) git-svn-id: http://mc-server.googlecode.com/svn/trunk@104 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cBlockToPickup.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source/cBlockToPickup.cpp') diff --git a/source/cBlockToPickup.cpp b/source/cBlockToPickup.cpp index 6e59e6573..c0597d005 100644 --- a/source/cBlockToPickup.cpp +++ b/source/cBlockToPickup.cpp @@ -50,7 +50,27 @@ ENUM_ITEM_ID cBlockToPickup::ToPickup( unsigned char a_BlockID, ENUM_ITEM_ID a_U return E_ITEM_REDSTONE_TORCH_ON; case E_BLOCK_MELON: return E_ITEM_MELON_SLICE; + case E_BLOCK_WOODEN_DOOR: + return E_ITEM_WOODEN_DOOR; + case E_BLOCK_IRON_DOOR: + return E_ITEM_IRON_DOOR; default: return (ENUM_ITEM_ID)a_BlockID; } } + +char cBlockToPickup::PickupCount(unsigned char a_BlockID) +{ + switch(a_BlockID) + { + case E_BLOCK_REDSTONE_ORE_GLOWING: + case E_BLOCK_REDSTONE_ORE: + return rand() % 2 + 4; + case E_BLOCK_MELON: + return rand() % 8 + 3; + case E_BLOCK_LAPIS_ORE: + return rand() % 5 + 4; + default: + return 1; + } +} \ No newline at end of file -- cgit v1.2.3