mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-23 00:12:51 +02:00
restrict ambientAirTemp to valid limits when set from Lua
This commit is contained in:
@@ -1935,7 +1935,7 @@ int LuaScriptInterface::simulation_ambientAirTemp(lua_State * l)
|
|||||||
lua_pushnumber(l, luacon_sim->air->ambientAirTemp);
|
lua_pushnumber(l, luacon_sim->air->ambientAirTemp);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
float ambientAirTemp = luaL_optnumber(l, 1, 295.15f);
|
float ambientAirTemp = restrict_flt(luaL_optnumber(l, 1, R_TEMP + 273.15f), MIN_TEMP, MAX_TEMP);
|
||||||
luacon_model->SetAmbientAirTemperature(ambientAirTemp);
|
luacon_model->SetAmbientAirTemperature(ambientAirTemp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user