1
0
Fork 0

Fix #12098: Don't allow unbunching at "nearest depot"

pull/12137/head
Tyler Trahan 2024-02-20 11:29:39 -05:00
parent 2d7ad9f717
commit ea061dedcd
2 changed files with 6 additions and 0 deletions

View File

@ -5113,6 +5113,7 @@ STR_ERROR_UNBUNCHING_NO_FULL_LOAD :{WHITE}... cann
STR_ERROR_UNBUNCHING_NO_UNBUNCHING_FULL_LOAD :{WHITE}... cannot unbunch a vehicle with a full load order STR_ERROR_UNBUNCHING_NO_UNBUNCHING_FULL_LOAD :{WHITE}... cannot unbunch a vehicle with a full load order
STR_ERROR_UNBUNCHING_NO_CONDITIONAL :{WHITE}... cannot use conditional orders when vehicle has an unbunching order STR_ERROR_UNBUNCHING_NO_CONDITIONAL :{WHITE}... cannot use conditional orders when vehicle has an unbunching order
STR_ERROR_UNBUNCHING_NO_UNBUNCHING_CONDITIONAL :{WHITE}... cannot unbunch a vehicle with a conditional order STR_ERROR_UNBUNCHING_NO_UNBUNCHING_CONDITIONAL :{WHITE}... cannot unbunch a vehicle with a conditional order
STR_ERROR_UNBUNCHING_NO_UNBUNCHING_NEAREST_DEPOT :{WHITE}... must choose a depot to unbunch at
# Autoreplace related errors # Autoreplace related errors
STR_ERROR_TRAIN_TOO_LONG_AFTER_REPLACEMENT :{WHITE}{VEHICLE} is too long after replacement STR_ERROR_TRAIN_TOO_LONG_AFTER_REPLACEMENT :{WHITE}{VEHICLE} is too long after replacement

View File

@ -820,6 +820,9 @@ CommandCost CmdInsertOrder(DoCommandFlag flags, VehicleID veh, VehicleOrderID se
if (new_order.GetDepotOrderType() & ~(ODTFB_PART_OF_ORDERS | ((new_order.GetDepotOrderType() & ODTFB_PART_OF_ORDERS) != 0 ? ODTFB_SERVICE : 0))) return CMD_ERROR; if (new_order.GetDepotOrderType() & ~(ODTFB_PART_OF_ORDERS | ((new_order.GetDepotOrderType() & ODTFB_PART_OF_ORDERS) != 0 ? ODTFB_SERVICE : 0))) return CMD_ERROR;
if (new_order.GetDepotActionType() & ~(ODATFB_HALT | ODATFB_NEAREST_DEPOT | ODATFB_UNBUNCH)) return CMD_ERROR; if (new_order.GetDepotActionType() & ~(ODATFB_HALT | ODATFB_NEAREST_DEPOT | ODATFB_UNBUNCH)) return CMD_ERROR;
if ((new_order.GetDepotOrderType() & ODTFB_SERVICE) && (new_order.GetDepotActionType() & ODATFB_HALT)) return CMD_ERROR; if ((new_order.GetDepotOrderType() & ODTFB_SERVICE) && (new_order.GetDepotActionType() & ODATFB_HALT)) return CMD_ERROR;
/* We don't allow unbunching at the nearest depot. The player must choose a specific depot. */
if ((new_order.GetDepotActionType() & ODATFB_NEAREST_DEPOT) && new_order.GetDepotActionType() & ODATFB_UNBUNCH) return CMD_ERROR;
break; break;
} }
@ -1310,6 +1313,8 @@ CommandCost CmdModifyOrder(DoCommandFlag flags, VehicleID veh, VehicleOrderID se
/* We don't allow unbunching if the vehicle has a full load order. */ /* We don't allow unbunching if the vehicle has a full load order. */
if (o->IsType(OT_GOTO_STATION) && o->GetLoadType() & (OLFB_FULL_LOAD | OLF_FULL_LOAD_ANY)) return_cmd_error(STR_ERROR_UNBUNCHING_NO_UNBUNCHING_FULL_LOAD); if (o->IsType(OT_GOTO_STATION) && o->GetLoadType() & (OLFB_FULL_LOAD | OLF_FULL_LOAD_ANY)) return_cmd_error(STR_ERROR_UNBUNCHING_NO_UNBUNCHING_FULL_LOAD);
} }
/* We don't allow unbunching at the nearest depot. The player must choose a specific depot. */
if (order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) return_cmd_error(STR_ERROR_UNBUNCHING_NO_UNBUNCHING_NEAREST_DEPOT);
} }
break; break;