Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ Template for new versions:
- `preserve-rooms`: automatically release room reservations for captured squad members. we were kidding ourselves with our optimistic kept reservations. they're unlikely to come back : ((
- `buildingplan`: add value info to item selection dialog (effectively ungrouping items with different values) and add sorting by value
- `timestream`: reduce CPU utilization
- `fix/occupancy`: additionally handle the case where tile occupancy doesn't reflect the actual existence of a building
- `fix/occupancy`: additionally handle the case where tile building occupancy needs to be set instead of cleared
- `orders`: make ``orders sort`` sort orders that are tied to a specific workshop first

## Documentation
- Dreamfort: add link to Dreamfort tutorial youtube series: https://www.youtube.com/playlist?list=PLzXx9JcB9oXxmrtkO1y8ZXzBCFEZrKxve
Expand Down
10 changes: 7 additions & 3 deletions plugins/orders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1011,8 +1011,12 @@ static command_result orders_clear_command(color_ostream & out)
return CR_OK;
}

static bool compare_freq(df::manager_order *a, df::manager_order *b)
static bool orders_compare(df::manager_order *a, df::manager_order *b)
{
if (a->workshop_id != b->workshop_id) {
return a->workshop_id >= 0;
}

if (a->frequency == df::manager_order::T_frequency::OneTime
|| b->frequency == df::manager_order::T_frequency::OneTime)
return a->frequency < b->frequency;
Expand All @@ -1025,11 +1029,11 @@ static command_result orders_sort_command(color_ostream & out)

if (!std::is_sorted(world->manager_orders.all.begin(),
world->manager_orders.all.end(),
compare_freq))
orders_compare))
{
std::stable_sort(world->manager_orders.all.begin(),
world->manager_orders.all.end(),
compare_freq);
orders_compare);
out << "Fixed priority of manager orders." << std::endl;
}

Expand Down
Loading