Skip to content

Commit 85d92f1

Browse files
committed
Properly check disabled state of training squad
The value of the training_squad state was being ignored, despite being used by the ui to distinguish between being enabled, or being disabled. This caused later disabled squads to remain in the pool of training squads.
1 parent e80d330 commit 85d92f1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

autotraining.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ end
139139

140140
function getTrainingSquads()
141141
local squads = {}
142-
for squad_id, _ in pairs(state.training_squads) do
142+
for squad_id, active in pairs(state.training_squads) do
143143
local squad = df.squad.find(squad_id)
144-
if squad then
144+
if active and squad then
145145
table.insert(squads, squad)
146146
else
147147
-- setting to nil during iteration is permitted by lua

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Template for new versions:
3333
## New Features
3434

3535
## Fixes
36+
- `autotraining`: squads once used for training then disabled now properly are treated as disabled.
3637

3738
## Misc Improvements
3839

0 commit comments

Comments
 (0)