summaryrefslogtreecommitdiffstats
path: root/src/Simulator/FireSimulator.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/Simulator/FireSimulator.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 '')
-rw-r--r--src/Simulator/FireSimulator.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp
index 5fc19ae15..1b2963bdc 100644
--- a/src/Simulator/FireSimulator.cpp
+++ b/src/Simulator/FireSimulator.cpp
@@ -301,7 +301,7 @@ int cFireSimulator::GetBurnStepTime(cChunk * a_Chunk, int a_RelX, int a_RelY, in
void cFireSimulator::TrySpreadFire(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_RelZ)
{
/*
- if (m_World.GetTickRandomNumber(10000) > 100)
+ if (GetRandomProvider().RandBool(0.99))
{
// Make the chance to spread 100x smaller
return;
@@ -317,7 +317,7 @@ void cFireSimulator::TrySpreadFire(cChunk * a_Chunk, int a_RelX, int a_RelY, int
// No need to check the coords for equality with the parent block,
// it cannot catch fire anyway (because it's not an air block)
- if (m_World.GetTickRandomNumber(MAX_CHANCE_FLAMMABILITY) > m_Flammability)
+ if (!GetRandomProvider().RandBool(m_Flammability * (1.0 / MAX_CHANCE_FLAMMABILITY)))
{
continue;
}
@@ -381,7 +381,7 @@ void cFireSimulator::RemoveFuelNeighbors(cChunk * a_Chunk, int a_RelX, int a_Rel
return;
}
- bool ShouldReplaceFuel = (m_World.GetTickRandomNumber(MAX_CHANCE_REPLACE_FUEL) < m_ReplaceFuelChance);
+ bool ShouldReplaceFuel = (GetRandomProvider().RandBool(m_ReplaceFuelChance * (1.0 / MAX_CHANCE_REPLACE_FUEL)));
if (ShouldReplaceFuel && !cRoot::Get()->GetPluginManager()->CallHookBlockSpread(m_World, AbsX, Y, AbsZ, ssFireSpread))
{
Neighbour->SetBlock(X, Y, Z, E_BLOCK_FIRE, 0);