]> git.lizzy.rs Git - minetest.git/blobdiff - src/script/lua_api/l_object.cpp
Sky: transmit body_orbit_tilt to client. (#13193)
[minetest.git] / src / script / lua_api / l_object.cpp
index fc2c1254b5f36eda44a99c1152417a9dcee33976..c754785905dd36dc9ae0f7a46ec45543f5370b9f 100644 (file)
@@ -1724,6 +1724,12 @@ int ObjectRef::l_set_sky(lua_State *L)
                        read_color(L, -1, &sky_params.bgcolor);
                lua_pop(L, 1);
 
+               lua_getfield(L, 2, "body_orbit_tilt");
+               if (!lua_isnil(L, -1)) {
+                       sky_params.body_orbit_tilt = rangelim(readParam<float>(L, -1), -60.0f, 60.0f);
+               }
+               lua_pop(L, 1);
+
                lua_getfield(L, 2, "type");
                if (!lua_isnil(L, -1))
                        sky_params.type = luaL_checkstring(L, -1);
@@ -1913,6 +1919,9 @@ int ObjectRef::l_get_sky(lua_State *L)
        lua_pushlstring(L, skybox_params.type.c_str(), skybox_params.type.size());
        lua_setfield(L, -2, "type");
 
+       lua_pushnumber(L, skybox_params.body_orbit_tilt);
+       lua_setfield(L, -2, "body_orbit_tilt");
+
        lua_newtable(L);
        s16 i = 1;
        for (const std::string &texture : skybox_params.textures) {