mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r11618) -Fix: buoys are just waypoints, so don't allow load/unload/transfert for them
This commit is contained in:
parent
fd23999fb9
commit
946fa3b9ee
@ -2254,6 +2254,16 @@ bool AfterLoadGame()
|
||||
}
|
||||
}
|
||||
|
||||
/* Update go to buoy orders because they are just waypoints */
|
||||
if (CheckSavegameVersion(84)) {
|
||||
Order *order;
|
||||
FOR_ALL_ORDERS(order) {
|
||||
if (order->type == OT_GOTO_STATION && GetStation(order->dest)->IsBuoy()) {
|
||||
order->flags = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return InitializeWindowsAndCaches();
|
||||
}
|
||||
|
||||
|
@ -676,7 +676,7 @@ CommandCost CmdModifyOrder(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
if (sel_ord >= v->num_orders) return CMD_ERROR;
|
||||
|
||||
order = GetVehicleOrder(v, sel_ord);
|
||||
if (order->type != OT_GOTO_STATION &&
|
||||
if ((order->type != OT_GOTO_STATION || GetStation(order->dest)->IsBuoy()) &&
|
||||
(order->type != OT_GOTO_DEPOT || p2 == OFB_UNLOAD) &&
|
||||
(order->type != OT_GOTO_WAYPOINT || p2 != OFB_NON_STOP)) {
|
||||
return CMD_ERROR;
|
||||
|
@ -152,7 +152,15 @@ static void DrawOrdersWindow(Window *w)
|
||||
|
||||
if (order != NULL) {
|
||||
switch (order->type) {
|
||||
case OT_GOTO_STATION: break;
|
||||
case OT_GOTO_STATION:
|
||||
if (!GetStation(order->dest)->IsBuoy()) break;
|
||||
/* Fall-through */
|
||||
|
||||
case OT_GOTO_WAYPOINT:
|
||||
w->DisableWidget(ORDER_WIDGET_FULL_LOAD);
|
||||
w->DisableWidget(ORDER_WIDGET_UNLOAD);
|
||||
w->DisableWidget(ORDER_WIDGET_TRANSFER);
|
||||
break;
|
||||
|
||||
case OT_GOTO_DEPOT:
|
||||
w->DisableWidget(ORDER_WIDGET_TRANSFER);
|
||||
@ -163,12 +171,6 @@ static void DrawOrdersWindow(Window *w)
|
||||
SetDParam(2,STR_SERVICE);
|
||||
break;
|
||||
|
||||
case OT_GOTO_WAYPOINT:
|
||||
w->DisableWidget(ORDER_WIDGET_FULL_LOAD);
|
||||
w->DisableWidget(ORDER_WIDGET_UNLOAD);
|
||||
w->DisableWidget(ORDER_WIDGET_TRANSFER);
|
||||
break;
|
||||
|
||||
default: // every other orders
|
||||
w->DisableWidget(ORDER_WIDGET_NON_STOP);
|
||||
w->DisableWidget(ORDER_WIDGET_FULL_LOAD);
|
||||
|
Loading…
Reference in New Issue
Block a user