ship_cmd.c
changeset 297 6c4ab6ff031f
parent 193 0a7025304867
child 337 cbe0c766c947
equal deleted inserted replaced
296:b079a8d997c2 297:6c4ab6ff031f
   661 				} else if ((v->next_order & OT_MASK) == OT_GOTO_STATION) {
   661 				} else if ((v->next_order & OT_MASK) == OT_GOTO_STATION) {
   662 					Station *st;
   662 					Station *st;
   663 
   663 
   664 					v->last_station_visited = v->next_order_param;
   664 					v->last_station_visited = v->next_order_param;
   665 
   665 
       
   666 					/* Process station in the schedule. Don't do that for buoys (HVOT_BUOY) */
   666 					st = DEREF_STATION(v->next_order_param);
   667 					st = DEREF_STATION(v->next_order_param);
   667 					if (!(st->had_vehicle_of_type & HVOT_BUOY)) {
   668 					if (!(st->had_vehicle_of_type & HVOT_BUOY) 
       
   669 							&& (st->facilities & FACIL_DOCK)) { /* ugly, ugly workaround for problem with ships able to drop off cargo at wrong stations */
   668 						v->next_order = (v->next_order & (OF_FULL_LOAD|OF_UNLOAD)) | OF_NON_STOP | OT_LOADING;
   670 						v->next_order = (v->next_order & (OF_FULL_LOAD|OF_UNLOAD)) | OF_NON_STOP | OT_LOADING;
   669 						ShipArrivesAt(v, st);
   671 						ShipArrivesAt(v, st);
   670 
   672 
   671 						SET_EXPENSES_TYPE(EXPENSES_SHIP_INC);
   673 						SET_EXPENSES_TYPE(EXPENSES_SHIP_INC);
   672 						if (LoadUnloadVehicle(v)) {
   674 						if (LoadUnloadVehicle(v)) {
   673 							InvalidateWindow(WC_SHIPS_LIST, v->owner);
   675 							InvalidateWindow(WC_SHIPS_LIST, v->owner);
   674 							MarkShipDirty(v);
   676 							MarkShipDirty(v);
   675 						}
   677 						}
   676 						InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, 4);
   678 						InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, 4);
   677 					} else {
   679 					} else { /* leave buoys right aways */
   678 						v->next_order = OT_LEAVESTATION;
   680 						v->next_order = OT_LEAVESTATION;
   679 						v->cur_order_index++;
   681 						v->cur_order_index++;
   680 						InvalidateVehicleOrderWidget(v);
   682 						InvalidateVehicleOrderWidget(v);
   681 					}
   683 					}
   682 					goto else_end;
   684 					goto else_end;