We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2250848 commit c325bd3Copy full SHA for c325bd3
1 file changed
autotraining.lua
@@ -225,6 +225,22 @@ function check()
225
local intraining_count = 0
226
local inque_count = 0
227
if ( squads == nil) then return end
228
+ for _,squad in ipairs(squads) do
229
+ for i=1,9,1 do
230
+ if ( squad.positions[i].occupant ~= -1 ) then
231
+ local hf = df.historical_figure.find(squad.positions[i].occupant)
232
+ if hf ~= nil then
233
+ local unit df.unit.find(hf.unit_id)
234
+ local training_need = getTrainingNeed(unit)
235
+ if ( training_need ~= nil ) then
236
+ if ( training_need.focus_level >= state.threshold ) then
237
+ dfhack.military.removeFromSquad(unit)
238
+ end
239
240
241
242
243
244
for _, unit in ipairs(getTrainingCandidates()) do
245
local need = getTrainingNeed(unit)
246
if ( need ~= nil ) then
0 commit comments