Skip to content

Commit 768e343

Browse files
committed
maintenance
Moved global variables to locals deleted unused content whitespace (preparation)
1 parent f644509 commit 768e343

4 files changed

Lines changed: 21 additions & 31 deletions

File tree

LuaUI/Widgets/gui_reclaiminfo.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ local rangeend = {} --counting radius end point
3636
local b1was = false -- cursor was outside the map?
3737
local vsx, vsy = widgetHandler:GetViewSizes()
3838
local form = 12 --text format depends on screen size
39-
local xstart,ystart = 0
39+
local xstart,ystart = 0, 0
4040
local cmd,xend,yend,x,y,b1,b2
4141
local inMinimap = false --mouse cursor in minimap
4242

LuaUI/Widgets/unit_smart_nanos.lua

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ end
2626
--------------------------------------------------------------------------------
2727
--------------------------------------------------------------------------------
2828

29-
local GetUnitDefID = Spring.GetUnitDefID
30-
local GetAllUnits = Spring.GetAllUnits
31-
local GetMyTeamID = Spring.GetMyTeamID
32-
local GetUnitNearestEnemy = Spring.GetUnitNearestEnemy
33-
local GiveOrderToUnit = Spring.GiveOrderToUnit
34-
local GetUnitHealth = Spring.GetUnitHealth
35-
local GetUnitsInCylinder = Spring.GetUnitsInCylinder
36-
local GetUnitPosition = Spring.GetUnitPosition
37-
local GetUnitCommandCount = Spring.GetUnitCommandCount
38-
local GetFeatureDefID = Spring.GetFeatureDefID
39-
local GetFeatureResources = Spring.GetFeatureResources
40-
local AreTeamsAllied = Spring.AreTeamsAllied
41-
local GetFeaturePosition = Spring.GetFeaturePosition
42-
local GetGameSeconds = Spring.GetGameSeconds
43-
local GetSelectedUnits = Spring.GetSelectedUnits
44-
local GetUnitTeam = Spring.GetUnitTeam
45-
local GetTeamResources = Spring.GetTeamResources
29+
local GetUnitDefID = Spring.GetUnitDefID
30+
local GetAllUnits = Spring.GetAllUnits
31+
local GetMyTeamID = Spring.GetMyTeamID
32+
local GetUnitNearestEnemy = Spring.GetUnitNearestEnemy
33+
local GiveOrderToUnit = Spring.GiveOrderToUnit
34+
local GetUnitHealth = Spring.GetUnitHealth
35+
local GetUnitsInCylinder = Spring.GetUnitsInCylinder
36+
local GetUnitPosition = Spring.GetUnitPosition
37+
local GetUnitCommandCount = Spring.GetUnitCommandCount
38+
local GetFeatureDefID = Spring.GetFeatureDefID
39+
local GetFeatureResources = Spring.GetFeatureResources
40+
local AreTeamsAllied = Spring.AreTeamsAllied
41+
local GetFeaturePosition = Spring.GetFeaturePosition
42+
local GetGameSeconds = Spring.GetGameSeconds
43+
local GetSelectedUnits = Spring.GetSelectedUnits
44+
local GetUnitTeam = Spring.GetUnitTeam
45+
local GetTeamResources = Spring.GetTeamResources
4646

4747
--------------------------------------------------------------------------------
4848
--------------------------------------------------------------------------------
@@ -155,7 +155,7 @@ function widget:CommandNotify(id, params, options)
155155
end
156156

157157
if (id == CMD.RECLAIM) then
158-
targetUnit = params[1]
158+
local targetUnit = params[1]
159159
teamUnits[targetUnit] = nil
160160
for unitID,unitDefs in pairs(nanoTurrets) do
161161
local cmdID, _, _, cmdParam = Spring.GetUnitCurrentCommand(unitID)
@@ -170,7 +170,7 @@ function widget:CommandNotify(id, params, options)
170170
end
171171

172172
if (id == CMD.REPAIR) then
173-
targetUnit = params[1]
173+
local targetUnit = params[1]
174174
if (not teamUnits[targetUnit]) and (not allyUnits[targetUnit]) and (not nanoTurrets[targetUnit])
175175
and (not buildUnits[targetUnit]) and (GetUnitTeam(targetUnit) == myTeamID) then
176176
widget:UnitFinished(targetUnit, GetUnitDefID(targetUnit), myTeamID)

effects/roach.lua

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,6 @@ return {
4040
},
4141
},
4242
blastwing = {
43-
groundflash = {
44-
flashalpha = 1,
45-
flashsize = 108,
46-
ttl = 75,
47-
color = {
48-
[1] = 0.7,
49-
[2] = 0.3,
50-
[3] = 0.1,
51-
},
52-
},
5343
redploom = {
5444
air = true,
5545
class = [[CExpGenSpawner]],

lups/lups.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ local function GameFrame(_,n)
921921
CleanInvalidUnitFX()
922922

923923
--// update FXs
924-
framesToUpdate = thisGameFrame - lastGameFrame
924+
local framesToUpdate = thisGameFrame - lastGameFrame
925925
for _,partFx in pairs(particles) do
926926
if (n>=partFx.dieGameFrame) then
927927
--// lifetime ended

0 commit comments

Comments
 (0)