Accidental Gloabals
Posted: Thu Dec 08, 2022 10:45 am
I was running a check on my mods, looking for variables that had accidentally been declared as globals. I found three in the base game:
common\Factorio\data\core\lualib\util.lua
I believe variables scale, shift, and tint should all be declared as local. I know this is minor but it would allow my test to pass!
common\Factorio\data\core\lualib\util.lua
Code: Select all
-- This function takes 2 icons tables, and adds the second to the first, but applies scale, shift and tint to the entire second set.
-- This allows you to manipulate the entire second icons table in the same way as you would manipulate a single icon when adding to the icons table.
function util.combine_icons(icons1, icons2, inputs, default_icon_size)
scale = inputs.scale or 1
shift = inputs.shift or {0, 0}
tint = inputs.tint or {r = 1, g = 1, b = 1, a = 1}