autolabor: Fix an array bounds overrun when assigning haulers while traders are active.

develop
Ben Lubar 2017-06-27 13:47:33 -05:00
parent 6af5f3b299
commit 967ab4ab1e
No known key found for this signature in database
GPG Key ID: 018BAB45DB2D2B24
1 changed files with 4 additions and 0 deletions

@ -1311,6 +1311,10 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
continue;
dwarfs[dwarf]->status.labors[labor] = false;
}
if (dwarf_info[dwarf].state == IDLE || dwarf_info[dwarf].state == BUSY || dwarf_info[dwarf].state == EXCLUSIVE)
{
num_haulers--;
}
continue;
}