diff --git a/plugins/orders.cpp b/plugins/orders.cpp index 4b93cff2d..0bb89a0bc 100644 --- a/plugins/orders.cpp +++ b/plugins/orders.cpp @@ -67,6 +67,7 @@ static command_result orders_sort_command(color_ostream & out); static command_result orders_sort_type_command(color_ostream & out); static command_result orders_sort_material_command(color_ostream & out); static command_result orders_recheck_command(color_ostream & out); +static command_result orders_recheck_current_command(color_ostream & out); static command_result orders_command(color_ostream & out, std::vector & parameters) { @@ -129,6 +130,14 @@ static command_result orders_command(color_ostream & out, std::vectorfrequency != b->frequency) + { + return compare_freq(a, b); + } + // Determine if only one order has reaction_name bool a_has_reaction_name = !a->reaction_name.empty(); bool b_has_reaction_name = !b->reaction_name.empty(); @@ -1077,8 +1092,8 @@ static bool compare_type(df::manager_order *a, df::manager_order *b) } } - // Fall back to freq sort - return compare_freq(a, b); + // By default orders are the same + return false; } static command_result orders_sort_type_command(color_ostream & out) @@ -1102,6 +1117,12 @@ static bool compare_material(df::manager_order *a, df::manager_order *b) // Goal: Sort orders to easily find them in the list and to see dupclicated orders. // Sorting by materials + // Divide orders by frequency first + if (a->frequency != b->frequency) + { + return compare_freq(a, b); + } + // Determine if only one of the orders has mat_type bool a_has_material = (a->mat_type != -1 || a->mat_index != -1); bool b_has_material = (b->mat_type != -1 || b->mat_index != -1); @@ -1169,3 +1190,17 @@ static command_result orders_recheck_command(color_ostream & out) } return CR_OK; } + +static command_result orders_recheck_current_command(color_ostream & out) +{ + if (game->main_interface.info.work_orders.conditions.open) + { + game->main_interface.info.work_orders.conditions.wq.status.active = false; + } + else + { + out << COLOR_LIGHTRED << "Order conditions is not open" << std::endl; + return CR_FAILURE; + } + return CR_OK; +}