summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Skeleton.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/Skeleton.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/Skeleton.cpp')
-rw-r--r--src/Mobs/Skeleton.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Mobs/Skeleton.cpp b/src/Mobs/Skeleton.cpp
index 311533b69..0d6d5e428 100644
--- a/src/Mobs/Skeleton.cpp
+++ b/src/Mobs/Skeleton.cpp
@@ -51,12 +51,12 @@ void cSkeleton::GetDrops(cItems & a_Drops, cEntity * a_Killer)
bool cSkeleton::Attack(std::chrono::milliseconds a_Dt)
{
StopMovingToPosition(); // Todo handle this in a better way, the skeleton does some uneeded recalcs due to inStateChasing
- cFastRandom Random;
+ auto & Random = GetRandomProvider();
if ((GetTarget() != nullptr) && (m_AttackCoolDownTicksLeft == 0))
{
- Vector3d Inaccuracy = Vector3d(Random.NextFloat(0.5) - 0.25, Random.NextFloat(0.5) - 0.25, Random.NextFloat(0.5) - 0.25);
+ Vector3d Inaccuracy = Vector3d(Random.RandReal<double>(-0.25, 0.25), Random.RandReal<double>(-0.25, 0.25), Random.RandReal<double>(-0.25, 0.25));
Vector3d Speed = (GetTarget()->GetPosition() + Inaccuracy - GetPosition()) * 5;
- Speed.y = Speed.y - 1 + Random.NextInt(3);
+ Speed.y += Random.RandInt(-1, 1);
cArrowEntity * Arrow = new cArrowEntity(this, GetPosX(), GetPosY() + 1, GetPosZ(), Speed);
if (Arrow == nullptr)
{