mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Reset day/night ratio even when passing no arguments (#13524)
* reset day_night_ratio when passing zero fields * Update lua_api.md --------- Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
This commit is contained in:
parent
180ec92ef9
commit
b60d38b7f9
2 changed files with 2 additions and 2 deletions
|
@ -2207,7 +2207,7 @@ int ObjectRef::l_override_day_night_ratio(lua_State *L)
|
|||
bool do_override = false;
|
||||
float ratio = 0.0f;
|
||||
|
||||
if (!lua_isnil(L, 2)) {
|
||||
if (!lua_isnoneornil(L, 2)) {
|
||||
do_override = true;
|
||||
ratio = readParam<float>(L, 2);
|
||||
luaL_argcheck(L, ratio >= 0.0f && ratio <= 1.0f, 1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue