summaryrefslogtreecommitdiffstats
path: root/source/cMonster.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-06 22:18:50 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-06 22:18:50 +0200
commit1cca9b13b3d320ff767cfc552413265b2ef6e0d6 (patch)
treec1227f3f4141dbf2f85767a65cb9d2102a9d4010 /source/cMonster.cpp
parentBlockIDs, ItemIDs and Metas updated, courtesy of Taugeshtu (diff)
downloadcuberite-1cca9b13b3d320ff767cfc552413265b2ef6e0d6.tar
cuberite-1cca9b13b3d320ff767cfc552413265b2ef6e0d6.tar.gz
cuberite-1cca9b13b3d320ff767cfc552413265b2ef6e0d6.tar.bz2
cuberite-1cca9b13b3d320ff767cfc552413265b2ef6e0d6.tar.lz
cuberite-1cca9b13b3d320ff767cfc552413265b2ef6e0d6.tar.xz
cuberite-1cca9b13b3d320ff767cfc552413265b2ef6e0d6.tar.zst
cuberite-1cca9b13b3d320ff767cfc552413265b2ef6e0d6.zip
Diffstat (limited to '')
-rw-r--r--source/cMonster.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/source/cMonster.cpp b/source/cMonster.cpp
index 1820bae4d..7834b855a 100644
--- a/source/cMonster.cpp
+++ b/source/cMonster.cpp
@@ -7,10 +7,7 @@
#include "cClientHandle.h"
#include "cWorld.h"
#include "cPlayer.h"
-#include "BlockID.h"
#include "Defines.h"
-#include "cPickup.h"
-#include "cItem.h"
#include "cMonsterConfig.h"
#include "MersenneTwister.h"
@@ -548,21 +545,16 @@ void cMonster::SetSightDistance(float sd)
-void cMonster::DropItem(ENUM_ITEM_ID a_Item, unsigned int a_Count)
+void cMonster::AddRandomDropItem(cItems & a_Drops, unsigned int a_Min, unsigned int a_Max, ENUM_ITEM_ID a_Item, short a_ItemHealth)
{
- if (a_Count > 0)
+ MTRand r1;
+ int Count = r1.randInt() % (a_Max + 1 - a_Min) + a_Min;
+ if (Count > 0)
{
- cPickup * Pickup = new cPickup( (int)(m_Pos.x * 32), (int)(m_Pos.y * 32), (int)(m_Pos.z * 32), cItem( a_Item, (char) a_Count ) );
- Pickup->Initialize( GetWorld() );
+ a_Drops.push_back(cItem(a_Item, Count, a_ItemHealth));
}
}
-
-void cMonster::RandomDropItem(ENUM_ITEM_ID a_Item, unsigned int a_Min, unsigned int a_Max)
-{
- MTRand r1;
- return cMonster::DropItem(a_Item, r1.randInt() % (a_Max + 1 - a_Min) + a_Min);
-} \ No newline at end of file