1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00
This commit is contained in:
Mircea Kitsune 2025-06-26 15:25:01 -07:00 committed by GitHub
commit 9314589cc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 109 additions and 86 deletions

View file

@ -2067,7 +2067,7 @@ int ObjectRef::l_set_sky(lua_State *L)
lua_getfield(L, 2, "textures");
sky_params.textures.clear();
if (lua_istable(L, -1) && sky_params.type == "skybox") {
if (lua_istable(L, -1) && sky_params.isSkybox()) {
lua_pushnil(L);
while (lua_next(L, -2) != 0) {
// Key is at index -2 and value at index -1
@ -2161,7 +2161,7 @@ int ObjectRef::l_set_sky(lua_State *L)
// Preserve old behavior of the sun, moon and stars
// when using the old set_sky call.
if (sky_params.type == "regular") {
if (sky_params.isTransparent()) {
sun_params.visible = true;
sun_params.sunrise_visible = true;
moon_params.visible = true;
@ -2183,7 +2183,7 @@ int ObjectRef::l_set_sky(lua_State *L)
lua_pop(L, 1);
}
}
if (sky_params.type == "skybox" && sky_params.textures.size() != 6)
if (sky_params.isSkybox() && sky_params.textures.size() != 6)
throw LuaError("Skybox expects 6 textures.");
sky_params.clouds = true;
@ -2202,7 +2202,7 @@ int ObjectRef::l_set_sky(lua_State *L)
static void push_sky_color(lua_State *L, const SkyboxParams &params)
{
lua_newtable(L);
if (params.type == "regular") {
if (params.isTransparent()) {
push_ARGB8(L, params.sky_color.day_sky);
lua_setfield(L, -2, "day_sky");
push_ARGB8(L, params.sky_color.day_horizon);