Skip to content

Commit

Permalink
SetGroundDecalAlpha: allow setting just falloff
Browse files Browse the repository at this point in the history
The alpha parameter is now optional so you can just set falloff without having to pass the current alpha.
  • Loading branch information
sprunk authored and lhog committed Feb 23, 2024
1 parent b0cacea commit da75c7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rts/Lua/LuaUnsyncedCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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);
Expand Down

0 comments on commit da75c7e

Please sign in to comment.