From f9479f66aa40695ccad3daa3c40d98efd315c55a Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 3 Apr 2013 16:54:49 +0000 Subject: Fixed crops producing pickups for creative mode players. FS #350 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1356 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Blocks/BlockCrops.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'source/Blocks/BlockCrops.h') diff --git a/source/Blocks/BlockCrops.h b/source/Blocks/BlockCrops.h index a269c7c32..6b33a400c 100644 --- a/source/Blocks/BlockCrops.h +++ b/source/Blocks/BlockCrops.h @@ -18,19 +18,15 @@ public: } - virtual void OnDestroyed(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ) override + virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_Meta) override { MTRand rand; - NIBBLETYPE Meta = a_World->GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ); - - cItems Drops; - if (Meta == 0x7) // Is fully grown + if (a_Meta == 0x7) // Is fully grown { - Drops.push_back(cItem(E_ITEM_WHEAT, 1, 0)); + a_Pickups.push_back(cItem(E_ITEM_WHEAT, 1, 0)); } - Drops.push_back(cItem(E_ITEM_SEEDS, (rand.randInt(3) == 0) ? 2 : 1, 0)); - a_World->SpawnItemPickups(Drops, a_BlockX, a_BlockY, a_BlockZ); + a_Pickups.push_back(cItem(E_ITEM_SEEDS, (rand.randInt(3) == 0) ? 2 : 1, 0)); } -- cgit v1.2.3