mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-30 11:19:51 +02:00
VIBR.cpp: change std::clamp to restrict_flt to handle NaNs
This commit is contained in:
@@ -107,7 +107,7 @@ int Element_VIBR_update(UPDATE_FUNC_ARGS)
|
|||||||
auto r = pmap[y+ry][x+rx];
|
auto r = pmap[y+ry][x+rx];
|
||||||
if (TYP(r) && TYP(r)!=PT_VIBR && TYP(r)!=PT_BVBR && elements[TYP(r)].HeatConduct && (TYP(r)!=PT_HSWC||parts[ID(r)].life==10))
|
if (TYP(r) && TYP(r)!=PT_VIBR && TYP(r)!=PT_BVBR && elements[TYP(r)].HeatConduct && (TYP(r)!=PT_HSWC||parts[ID(r)].life==10))
|
||||||
{
|
{
|
||||||
parts[ID(r)].temp = std::clamp(parts[ID(r)].temp + parts[i].tmp * 3, MIN_TEMP, MAX_TEMP);
|
parts[ID(r)].temp = restrict_flt(parts[ID(r)].temp + parts[i].tmp * 3, MIN_TEMP, MAX_TEMP);
|
||||||
parts[i].tmp = 0;
|
parts[i].tmp = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user