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; }