From 1cca9b13b3d320ff767cfc552413265b2ef6e0d6 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 6 Jun 2012 20:18:50 +0000 Subject: Item-dropping code rewritten and centralized - now there's only one place to modify if we want to split or merge same-item drops: cWorld:SpawnItemPickups(). Also, mined blocks can now drop more items, and they recognize if they're being mined by the correct tool. git-svn-id: http://mc-server.googlecode.com/svn/trunk@561 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunkMap.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'source/cChunkMap.cpp') diff --git a/source/cChunkMap.cpp b/source/cChunkMap.cpp index f28e2ecb0..93bc8ded0 100644 --- a/source/cChunkMap.cpp +++ b/source/cChunkMap.cpp @@ -23,17 +23,6 @@ -#define RECI_RAND_MAX (1.f/RAND_MAX) -inline float fRadRand( float a_Radius ) -{ - MTRand r1; - return ((float)r1.rand() * RECI_RAND_MAX)*a_Radius - a_Radius*0.5f; -} - - - - - //////////////////////////////////////////////////////////////////////////////// // cChunkMap: @@ -747,7 +736,7 @@ bool cChunkMap::GetBlocks(sSetBlockVector & a_Blocks, bool a_ContinueOnFailure) -bool cChunkMap::DigBlock(int a_X, int a_Y, int a_Z, cItem & a_PickupItem) +bool cChunkMap::DigBlock(int a_X, int a_Y, int a_Z) { int PosX = a_X, PosY = a_Y, PosZ = a_Z, ChunkX, ChunkZ; @@ -766,11 +755,6 @@ bool cChunkMap::DigBlock(int a_X, int a_Y, int a_Z, cItem & a_PickupItem) m_World->GetSimulatorManager()->WakeUp(a_X, a_Y, a_Z); - if ( !a_PickupItem.IsEmpty() ) - { - cPickup * Pickup = new cPickup( a_X * 32 + 16 + (int)fRadRand(16.f), a_Y * 32 + 16 + (int)fRadRand(16.f), a_Z * 32 + 16 + (int)fRadRand(16.f), a_PickupItem ); - Pickup->Initialize(m_World); - } return true; } -- cgit v1.2.3