@@ -52,8 +52,8 @@ local spGetFeaturePosition = Spring.GetFeaturePosition
5252---- ----------------------------------------------------------------------------
5353---- ----------------------------------------------------------------------------
5454
55- local UPDATE = 0.5 -- Response time for commands
56- local NANO_GROUPS = 8 -- Groups to split nanoturrets into
55+ local UPDATE = 0.5 -- Response time for commands
56+ local NANO_GROUPS = 8 -- Groups to split nanoturrets into
5757local UPDATE_TICK = 2.5 -- Seconds to check if last order is still the best
5858
5959---- ----------------------------------------------------------------------------
@@ -82,7 +82,7 @@ function widget:Initialize()
8282 return
8383 end
8484 myTeamID = spGetMyTeamID ()
85-
85+
8686 for _ ,unitID in ipairs (spGetAllUnits ()) do
8787 local unitTeam = spGetUnitTeam (unitID )
8888 if (unitTeam == myTeamID ) or spAreTeamsAllied (unitTeam , myTeamID ) then
@@ -95,7 +95,7 @@ function widget:Initialize()
9595 end
9696 end
9797 end
98-
98+
9999 UPDATE = (UPDATE / NANO_GROUPS )
100100end
101101
@@ -108,13 +108,13 @@ end
108108
109109function widget :UnitFinished (unitID , unitDefID , unitTeam )
110110 if (unitTeam == myTeamID ) then
111-
111+
112112 buildUnits [unitID ] = nil
113-
113+
114114 teamUnits [unitID ] = {}
115115 teamUnits [unitID ].unitDefID = unitDefID
116116 teamUnits [unitID ].damaged = false
117-
117+
118118 if (UnitDefs [unitDefID ].isBuilder and not UnitDefs [unitDefID ].canMove ) then
119119 nanoTurrets [unitID ] = {}
120120 nanoTurrets [unitID ].unitDefID = unitDefID
@@ -142,14 +142,14 @@ end
142142
143143function widget :CommandNotify (id , params , options )
144144 local selUnits = spGetSelectedUnits ()
145-
145+
146146 for _ ,unitID in ipairs (selUnits ) do
147147 if nanoTurrets [unitID ] then
148148 nanoTurrets [unitID ].auto = false
149149 orderQueue [unitID ] = nil
150150 end
151151 end
152-
152+
153153 if (id == CMD .RECLAIM ) then
154154 local targetUnit = params [1 ]
155155 teamUnits [targetUnit ] = nil
@@ -164,7 +164,7 @@ function widget:CommandNotify(id, params, options)
164164 end
165165 end
166166 end
167-
167+
168168 if (id == CMD .REPAIR ) then
169169 local targetUnit = params [1 ]
170170 if (not teamUnits [targetUnit ]) and (not allyUnits [targetUnit ]) and (not nanoTurrets [targetUnit ])
@@ -273,7 +273,7 @@ function widget:Update(deltaTime)
273273 if (unitDefs .pointer == pointer ) then
274274 local curH , maxH = spGetUnitHealth (unitID )
275275 nanoTurrets [unitID ].damaged = curH < maxH
276-
276+
277277 local prevCommand , _ , _ , prevUnit = spGetUnitCurrentCommand (unitID )
278278 local cQueueCount = spGetUnitCommandCount (unitID )
279279
0 commit comments