aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
authorWuzzy <Wuzzy@disroot.org>2022-07-02 18:57:48 +0000
committerGitHub <noreply@github.com>2022-07-02 19:57:48 +0100
commit142928e944db089cccce6c0ea32a89b32300b3d1 (patch)
tree666fa8664a4a0a4d2d365d24ff61448e257759cc /src/script/lua_api
parentb095dc4f2bf2a1ace010dfae0ead69654b0ca3ac (diff)
downloadminetest-142928e944db089cccce6c0ea32a89b32300b3d1.tar.gz
minetest-142928e944db089cccce6c0ea32a89b32300b3d1.tar.bz2
minetest-142928e944db089cccce6c0ea32a89b32300b3d1.zip
Allow to set maximum star opacity at daytime (#11663)
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_object.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp
index 37ba1521a..6bd07a4c1 100644
--- a/src/script/lua_api/l_object.cpp
+++ b/src/script/lua_api/l_object.cpp
@@ -2084,6 +2084,9 @@ int ObjectRef::l_set_stars(lua_State *L)
"scale", star_params.scale);
}
+ star_params.day_opacity = getfloatfield_default(L, 2,
+ "day_opacity", star_params.day_opacity);
+
getServer(L)->setStars(player, star_params);
return 0;
}
@@ -2108,6 +2111,8 @@ int ObjectRef::l_get_stars(lua_State *L)
lua_setfield(L, -2, "star_color");
lua_pushnumber(L, star_params.scale);
lua_setfield(L, -2, "scale");
+ lua_pushnumber(L, star_params.day_opacity);
+ lua_setfield(L, -2, "day_opacity");
return 1;
}