summaryrefslogtreecommitdiff
path: root/plugins/sort.cpp
diff options
context:
space:
mode:
authorPetr Mrázek2012-08-03 16:09:51 +0200
committerPetr Mrázek2012-08-03 16:09:51 +0200
commit81ea0345ad8f9347ce6ef14bdd779ee1bef438a7 (patch)
tree5ff97407c24de6e916e0e3dea2dd6681287b47d6 /plugins/sort.cpp
parent61195859e3544e17cd702676e6b7b8015684622a (diff)
downloaddfhack-81ea0345ad8f9347ce6ef14bdd779ee1bef438a7.tar.gz
dfhack-81ea0345ad8f9347ce6ef14bdd779ee1bef438a7.tar.bz2
dfhack-81ea0345ad8f9347ce6ef14bdd779ee1bef438a7.tar.xz
Fix cage-related bug in the sort plugin.
Diffstat (limited to 'plugins/sort.cpp')
-rw-r--r--plugins/sort.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/sort.cpp b/plugins/sort.cpp
index 5748a065..ff51fc77 100644
--- a/plugins/sort.cpp
+++ b/plugins/sort.cpp
@@ -431,12 +431,17 @@ DEFINE_SORT_HANDLER(unit_sorters, dwarfmode, "/QueryBuilding/Some/Assign", scree
sort_null_first(parameters);
PARSE_SPEC("units", parameters);
-
if (compute_order(*pout, L, top, &order, *ui_building_assign_units))
{
reorder_cursor(ui_building_item_cursor, order);
reorder_vector(ui_building_assign_type, order);
reorder_vector(ui_building_assign_units, order);
+ // this is for cages. cages need some extra sorting
+ if(ui_building_assign_items->size() == ui_building_assign_units->size())
+ {
+ reorder_vector(ui_building_assign_items, order);
+ reorder_vector(ui_building_assign_is_marked, order);
+ }
}
}