mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Merge cc363a77d7
into 2d36d32da8
This commit is contained in:
commit
9314589cc7
8 changed files with 109 additions and 86 deletions
|
@ -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 ¶ms)
|
||||
{
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue