From da75c7e868aba80fedd50581a3d590bc2883bfef Mon Sep 17 00:00:00 2001 From: sprunk Date: Fri, 23 Feb 2024 17:53:23 +0100 Subject: [PATCH] SetGroundDecalAlpha: allow setting just falloff The alpha parameter is now optional so you can just set falloff without having to pass the current alpha. --- rts/Lua/LuaUnsyncedCtrl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rts/Lua/LuaUnsyncedCtrl.cpp b/rts/Lua/LuaUnsyncedCtrl.cpp index 8f2594dd24..aae04ec97c 100644 --- a/rts/Lua/LuaUnsyncedCtrl.cpp +++ b/rts/Lua/LuaUnsyncedCtrl.cpp @@ -4600,7 +4600,7 @@ int LuaUnsyncedCtrl::SetGroundDecalTexture(lua_State* L) * * @function Spring.SetGroundDecalAlpha * @number decalID - * @number alpha + * @number[opt=currAlpha] alpha * @number[opt=currAlphaFalloff] alphaFalloff * @treturn bool decalSet */ @@ -4612,7 +4612,7 @@ int LuaUnsyncedCtrl::SetGroundDecalAlpha(lua_State* L) return 1; } - decal->alpha = luaL_checkfloat(L, 2); + decal->alpha = luaL_optfloat(L, 2, decal->alpha); decal->alphaFalloff = luaL_optfloat(L, 3, decal->alphaFalloff); lua_pushboolean(L, true);