From 360d8eade0332f2c1aa5c205ca772cd506c35b26 Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Tue, 13 Jun 2017 20:35:30 +0100 Subject: FastRandom rewrite (#3754) --- src/Entities/ThrownEggEntity.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Entities/ThrownEggEntity.cpp') diff --git a/src/Entities/ThrownEggEntity.cpp b/src/Entities/ThrownEggEntity.cpp index b20050529..3131f4841 100644 --- a/src/Entities/ThrownEggEntity.cpp +++ b/src/Entities/ThrownEggEntity.cpp @@ -74,11 +74,12 @@ void cThrownEggEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) void cThrownEggEntity::TrySpawnChicken(const Vector3d & a_HitPos) { - if (m_World->GetTickRandomNumber(7) == 1) + auto & Random = GetRandomProvider(); + if (Random.RandBool(0.125)) { m_World->SpawnMob(a_HitPos.x, a_HitPos.y, a_HitPos.z, mtChicken, true); } - else if (m_World->GetTickRandomNumber(32) == 1) + else if (Random.RandBool(1.0 / 33.0)) { m_World->SpawnMob(a_HitPos.x, a_HitPos.y, a_HitPos.z, mtChicken, true); m_World->SpawnMob(a_HitPos.x, a_HitPos.y, a_HitPos.z, mtChicken, true); -- cgit v1.2.3