mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Fix crash when stars are reset
This commit is contained in:
parent
4fbcc33ee0
commit
bcc56803d7
@ -1366,7 +1366,7 @@ int ObjectRef::l_get_player_control(lua_State *L)
|
|||||||
lua_newtable(L);
|
lua_newtable(L);
|
||||||
if (player == nullptr)
|
if (player == nullptr)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
const PlayerControl &control = player->getPlayerControl();
|
const PlayerControl &control = player->getPlayerControl();
|
||||||
lua_pushboolean(L, control.direction_keys & (1 << 0));
|
lua_pushboolean(L, control.direction_keys & (1 << 0));
|
||||||
lua_setfield(L, -2, "up");
|
lua_setfield(L, -2, "up");
|
||||||
@ -2082,11 +2082,10 @@ int ObjectRef::l_set_stars(lua_State *L)
|
|||||||
|
|
||||||
star_params.scale = getfloatfield_default(L, 2,
|
star_params.scale = getfloatfield_default(L, 2,
|
||||||
"scale", star_params.scale);
|
"scale", star_params.scale);
|
||||||
|
star_params.day_opacity = getfloatfield_default(L, 2,
|
||||||
|
"day_opacity", star_params.day_opacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
star_params.day_opacity = getfloatfield_default(L, 2,
|
|
||||||
"day_opacity", star_params.day_opacity);
|
|
||||||
|
|
||||||
getServer(L)->setStars(player, star_params);
|
getServer(L)->setStars(player, star_params);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user