(svn r303) Fix: [ 1022227 ] Ships could unload cargo at stations without docks
authordominik
Mon, 20 Sep 2004 19:09:06 +0000
changeset 297 5a89d926db2d
parent 296 7482b93ce376
child 298 b3e83b94be19
(svn r303) Fix: [ 1022227 ] Ships could unload cargo at stations without docks
ship_cmd.c
--- a/ship_cmd.c	Mon Sep 20 14:49:53 2004 +0000
+++ b/ship_cmd.c	Mon Sep 20 19:09:06 2004 +0000
@@ -663,8 +663,10 @@
 
 					v->last_station_visited = v->next_order_param;
 
+					/* Process station in the schedule. Don't do that for buoys (HVOT_BUOY) */
 					st = DEREF_STATION(v->next_order_param);
-					if (!(st->had_vehicle_of_type & HVOT_BUOY)) {
+					if (!(st->had_vehicle_of_type & HVOT_BUOY) 
+							&& (st->facilities & FACIL_DOCK)) { /* ugly, ugly workaround for problem with ships able to drop off cargo at wrong stations */
 						v->next_order = (v->next_order & (OF_FULL_LOAD|OF_UNLOAD)) | OF_NON_STOP | OT_LOADING;
 						ShipArrivesAt(v, st);
 
@@ -674,7 +676,7 @@
 							MarkShipDirty(v);
 						}
 						InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, 4);
-					} else {
+					} else { /* leave buoys right aways */
 						v->next_order = OT_LEAVESTATION;
 						v->cur_order_index++;
 						InvalidateVehicleOrderWidget(v);