summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-04-12 14:14:35 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-04-12 14:14:35 +0200
commitb3f6afefe9a70741734944027573de5834939349 (patch)
treee63ecdfd4b3ebe98b27e2afdb0d8d5e3c952a844 /src/World.cpp
parentFixed enchantment parsing. (diff)
downloadcuberite-b3f6afefe9a70741734944027573de5834939349.tar
cuberite-b3f6afefe9a70741734944027573de5834939349.tar.gz
cuberite-b3f6afefe9a70741734944027573de5834939349.tar.bz2
cuberite-b3f6afefe9a70741734944027573de5834939349.tar.lz
cuberite-b3f6afefe9a70741734944027573de5834939349.tar.xz
cuberite-b3f6afefe9a70741734944027573de5834939349.tar.zst
cuberite-b3f6afefe9a70741734944027573de5834939349.zip
Diffstat (limited to 'src/World.cpp')
-rw-r--r--src/World.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/World.cpp b/src/World.cpp
index c188fd522..1ba849806 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -1632,7 +1632,6 @@ bool cWorld::WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a_MinBlock
void cWorld::SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double a_BlockY, double a_BlockZ, double a_FlyAwaySpeed, bool IsPlayerCreated)
{
- MTRand r1;
a_FlyAwaySpeed /= 100; // Pre-divide, so that we don't have to divide each time inside the loop
for (cItems::const_iterator itr = a_Pickups.begin(); itr != a_Pickups.end(); ++itr)
{
@@ -1642,9 +1641,9 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double
continue;
}
- float SpeedX = (float)(a_FlyAwaySpeed * (r1.randInt(10) - 5));
- float SpeedY = (float)(a_FlyAwaySpeed * r1.randInt(50));
- float SpeedZ = (float)(a_FlyAwaySpeed * (r1.randInt(10) - 5));
+ float SpeedX = (float)(a_FlyAwaySpeed * (GetTickRandomNumber(10) - 5));
+ float SpeedY = (float)(a_FlyAwaySpeed * GetTickRandomNumber(50));
+ float SpeedZ = (float)(a_FlyAwaySpeed * (GetTickRandomNumber(10) - 5));
cPickup * Pickup = new cPickup(
a_BlockX, a_BlockY, a_BlockZ,