Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit edf9cd9

Browse files
committed
remove vanilla partitioning for squad members
1 parent 305c5ec commit edf9cd9

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

docs/plugins/sort.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ capabilities to the squad assignment list. The currently selected annotation is
2121
shown in the panel to the left of the unit list. Clicking on the arrow icon
2222
above the annotations will sort the unit list by that annotation value, or, if
2323
the list is already sorted by the annotation value, will switch between
24-
descending and ascending sort. Remember, vanilla forces units in other squads
25-
to appear at the end of the list, so the bottom of the list will be slightly
26-
out of order unless you have units from other squads filtered out (more
27-
information on the filters below).
24+
descending and ascending sort.
2825

2926
Annotations and sort orders
3027
~~~~~~~~~~~~~~~~~~~~~~~~~~~

plugins/sort.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ static void sort_set_filter_fn(color_ostream &out) {
183183
DEBUG(log).print("adding our filter function\n");
184184
auto filter_vec = reinterpret_cast<filter_vec_type *>(&unitlist->filter_func);
185185
filter_vec->emplace_back(do_filter);
186+
DEBUG(log).print("clearing partitions\n"); // removes sorting other squads to end
187+
auto partitions_vec = reinterpret_cast<filter_vec_type *>(&unitlist->partitions);
188+
partitions_vec->clear();
186189
unitlist->sort_flags.bits.NEEDS_RESORTED = true;
187190
}
188191
}

0 commit comments

Comments
 (0)