summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Slime.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2017-06-13 21:35:30 +0200
committerLukas Pioch <lukas@zgow.de>2017-06-13 21:35:30 +0200
commit360d8eade0332f2c1aa5c205ca772cd506c35b26 (patch)
tree066fde557310742a39020bad9bc4aa2a5ef8d51a /src/Mobs/Slime.cpp
parentCorrected check for level of subcommand and fixed multiple levels not working (#3758) (diff)
downloadcuberite-360d8eade0332f2c1aa5c205ca772cd506c35b26.tar
cuberite-360d8eade0332f2c1aa5c205ca772cd506c35b26.tar.gz
cuberite-360d8eade0332f2c1aa5c205ca772cd506c35b26.tar.bz2
cuberite-360d8eade0332f2c1aa5c205ca772cd506c35b26.tar.lz
cuberite-360d8eade0332f2c1aa5c205ca772cd506c35b26.tar.xz
cuberite-360d8eade0332f2c1aa5c205ca772cd506c35b26.tar.zst
cuberite-360d8eade0332f2c1aa5c205ca772cd506c35b26.zip
Diffstat (limited to 'src/Mobs/Slime.cpp')
-rw-r--r--src/Mobs/Slime.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Mobs/Slime.cpp b/src/Mobs/Slime.cpp
index dca5c5887..3f832ae87 100644
--- a/src/Mobs/Slime.cpp
+++ b/src/Mobs/Slime.cpp
@@ -70,8 +70,8 @@ void cSlime::KilledBy(TakeDamageInfo & a_TDI)
if (m_Size != 1)
{
- cFastRandom Random;
- int SpawnAmount = 2 + Random.NextInt(3);
+ auto & Random = GetRandomProvider();
+ int SpawnAmount = Random.RandInt(2, 4);
for (int i = 0; i < SpawnAmount; ++i)
{
@@ -80,7 +80,7 @@ void cSlime::KilledBy(TakeDamageInfo & a_TDI)
cSlime * NewSlime = new cSlime(m_Size / 2);
NewSlime->SetPosition(GetPosX() + AddX, GetPosY() + 0.5, GetPosZ() + AddZ);
- NewSlime->SetYaw(Random.NextFloat(1.0f) * 360.0f);
+ NewSlime->SetYaw(Random.RandReal(360.0f));
m_World->SpawnMobFinalize(NewSlime);
}
}