1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Lua API: Document shader dependencies of set_lighting() (#13079)

This commit is contained in:
SmallJoker 2022-12-26 21:59:55 +01:00 committed by GitHub
parent 1e7804aaf6
commit 03e710160f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -2294,10 +2294,10 @@ int ObjectRef::l_set_lighting(lua_State *L)
Lighting lighting = player->getLighting();
lua_getfield(L, 2, "shadows");
if (lua_istable(L, -1)) {
lighting.shadow_intensity = getfloatfield_default(L, -1, "intensity", lighting.shadow_intensity);
getfloatfield(L, -1, "intensity", lighting.shadow_intensity);
}
lighting.saturation = getfloatfield_default(L, 2, "saturation", lighting.saturation);
lua_pop(L, -1);
lua_pop(L, 1); // shadows
getfloatfield(L, -1, "saturation", lighting.saturation);
getServer(L)->setLighting(player, lighting);
return 0;