Skip to content

Assorted patches#5797

Open
SteelBlueZK wants to merge 1 commit into
ZeroK-RTS:masterfrom
SteelBlueZK:patch_01
Open

Assorted patches#5797
SteelBlueZK wants to merge 1 commit into
ZeroK-RTS:masterfrom
SteelBlueZK:patch_01

Conversation

@SteelBlueZK

Copy link
Copy Markdown
Contributor

LuaUI/Widgets/gui_reclaiminfo.lua

  • Initilized 2 variables instead of 1 for clarity

effects/roach.lua

  • Table defined 2 properties "groundflash", got rid of the redundant one. The redundant one was getting overwritten by the latter one.

lups/lups.lua

  • global scope variable pulled back to local scope

LuaUI/Widgets/unit_smart_nanos.lua

  • uhhh.... Errr... My linter informed me there was a reference to a global variable, which was probably meant to reference a local variable defined below it, but then I noticed many other things that are messy with this file.... This isn't even the default caretaker controller, and maybe it should be deleted. The logic is actually all over the place, Histidine added it to the repo "so someone else can figure it out" and noone seems to have done so.

@sprunk sprunk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in the 3 smaller files look good, some nits around smart nanos though.

Comment thread LuaUI/Widgets/unit_smart_nanos.lua Outdated
local GetSelectedUnits = Spring.GetSelectedUnits
local GetUnitTeam = Spring.GetUnitTeam
local GetTeamResources = Spring.GetTeamResources
local spGetFeaturesInCylinder = Spring.GetFeaturesInCylinder

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The project-wide convention is spFoo = Spring.Foo, but the existing lines are just Foo = Spring.Foo so now there's inconsistent style. If we're linting the file perhaps bring the others up to the spFoo standard.

Comment thread LuaUI/Widgets/unit_smart_nanos.lua Outdated
@SteelBlueZK

SteelBlueZK commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

What do you say I remove changes to unit_smart_nanos and just push the 3 tiny changes?

my linter pointed to this line and said "global variable" and indeed "bestUnit" is global in this scope. It gets defined in local scopes down the function in 2 separate if statements.

@sprunk

sprunk commented Jul 24, 2026

Copy link
Copy Markdown
Member

If you'd like to do more with smart nanos then a standalone PR for the 3 tiny changes to get them out of the way sounds ok.

But could also remove the sp from spGetFeaturesInCylinder to be consistent with what exists (rather than plow through the entire file to add sp to everything else) and I think that would also be immediately mergeable.

Moved global variables to locals
deleted unused content
clarified declaration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants