FIRE.cpp: minor improvements on readibility (#872)

This commit is contained in:
CanGonenc 2022-12-21 04:39:10 +03:00 committed by GitHub
parent 3be884513d
commit ed9d405742
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,10 +87,10 @@ int Element_FIRE_update(UPDATE_FUNC_ARGS)
} }
} }
break; break;
case PT_LAVA: case PT_LAVA: {
float pres = sim->pv[y / CELL][x / CELL];
if (parts[i].ctype == PT_ROCK) if (parts[i].ctype == PT_ROCK)
{ {
float pres = sim->pv[y / CELL][x / CELL];
if (pres <= -9) if (pres <= -9)
{ {
parts[i].ctype = PT_STNE; 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].tmp2 = RNG::Ref().between(0, 10); // Provide tmp2 for color noise
parts[i].ctype = PT_ROCK; parts[i].ctype = PT_ROCK;
} }
break; break;
}
default: default:
break; break;
} }