From ed9d4057427eb709d219d2dbfb19a33a073bacc8 Mon Sep 17 00:00:00 2001 From: CanGonenc <96113651+CanGonenc@users.noreply.github.com> Date: Wed, 21 Dec 2022 04:39:10 +0300 Subject: [PATCH] FIRE.cpp: minor improvements on readibility (#872) --- src/simulation/elements/FIRE.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/simulation/elements/FIRE.cpp b/src/simulation/elements/FIRE.cpp index 851d8c04c..10d23f7f3 100644 --- a/src/simulation/elements/FIRE.cpp +++ b/src/simulation/elements/FIRE.cpp @@ -87,10 +87,10 @@ int Element_FIRE_update(UPDATE_FUNC_ARGS) } } break; - case PT_LAVA: + case PT_LAVA: { + float pres = sim->pv[y / CELL][x / CELL]; if (parts[i].ctype == PT_ROCK) - { - float pres = sim->pv[y / CELL][x / CELL]; + { if (pres <= -9) { parts[i].ctype = PT_STNE; @@ -131,12 +131,13 @@ int Element_FIRE_update(UPDATE_FUNC_ARGS) } } } - else if ((parts[i].ctype == PT_STNE || !parts[i].ctype) && sim->pv[y / CELL][x / CELL] >= 30.0f && (parts[i].temp > 1943.15f || sim->pv[y / CELL][x / CELL] < 120.0f)) // Form ROCK with pressure, if it will stay molten or not immediately break + else if ((parts[i].ctype == PT_STNE || !parts[i].ctype) && pres >= 30.0f && (parts[i].temp > sim->elements[PT_ROCK].HighTemperature || pres < sim->elements[PT_ROCK].HighPressure)) // Form ROCK with pressure, if it will stay molten or not immediately break { parts[i].tmp2 = RNG::Ref().between(0, 10); // Provide tmp2 for color noise parts[i].ctype = PT_ROCK; } break; + } default: break; }