ship_gui.c
changeset 555 02df8a1b7f33
parent 543 946badd71033
child 588 03521b270f62
equal deleted inserted replaced
554:a4ba0fbbf018 555:02df8a1b7f33
   496 		if (v->breakdown_ctr == 1) {
   496 		if (v->breakdown_ctr == 1) {
   497 			str = STR_885C_BROKEN_DOWN;
   497 			str = STR_885C_BROKEN_DOWN;
   498 		} else if (v->vehstatus & VS_STOPPED) {
   498 		} else if (v->vehstatus & VS_STOPPED) {
   499 			str = STR_8861_STOPPED;
   499 			str = STR_8861_STOPPED;
   500 		} else {
   500 		} else {
   501 			switch(v->next_order & OT_MASK) {
   501 			switch (v->current_order.type) {
   502 			case OT_GOTO_STATION: {
   502 			case OT_GOTO_STATION: {
   503 				SetDParam(0, v->next_order_param);
   503 				SetDParam(0, v->current_order.station);
   504 				SetDParam(1, v->cur_speed * 10 >> 5);
   504 				SetDParam(1, v->cur_speed * 10 >> 5);
   505 				str = STR_HEADING_FOR_STATION + _patches.vehicle_speed;
   505 				str = STR_HEADING_FOR_STATION + _patches.vehicle_speed;
   506 			} break;
   506 			} break;
   507 
   507 
   508 			case OT_GOTO_DEPOT: {
   508 			case OT_GOTO_DEPOT: {
   509 				Depot *dep = &_depots[v->next_order_param];
   509 				Depot *dep = &_depots[v->current_order.station];
   510 				SetDParam(0, dep->town_index);
   510 				SetDParam(0, dep->town_index);
   511 				SetDParam(1, v->cur_speed * 10 >> 5);
   511 				SetDParam(1, v->cur_speed * 10 >> 5);
   512 				str = STR_HEADING_FOR_SHIP_DEPOT + _patches.vehicle_speed;
   512 				str = STR_HEADING_FOR_SHIP_DEPOT + _patches.vehicle_speed;
   513 			} break;
   513 			} break;
   514 
   514 
   834 	}
   834 	}
   835 }
   835 }
   836 
   836 
   837 
   837 
   838 static void DrawSmallShipSchedule(Vehicle *v, int x, int y) {
   838 static void DrawSmallShipSchedule(Vehicle *v, int x, int y) {
   839 	uint16 *sched;
   839 	Order *sched;
   840 	int sel;
   840 	int sel;
   841 	uint ord;
       
   842 	Station *st;
   841 	Station *st;
   843 	int i = 0;
   842 	int i = 0;
   844 
   843 
   845 	sched = v->schedule_ptr;
       
   846 	sel = v->cur_order_index;
   844 	sel = v->cur_order_index;
   847 
   845 
   848 	while ((ord=*sched++) != 0) {
   846 	for (sched = v->schedule_ptr; sched->type != OT_NOTHING; ++sched) {
   849 		if (sel == 0) {
   847 		if (sel == 0) {
   850 			_stringwidth_base = 0xE0;
   848 			_stringwidth_base = 0xE0;
   851 			DoDrawString( "\xAF", x-6, y, 16);
   849 			DoDrawString( "\xAF", x-6, y, 16);
   852 			_stringwidth_base = 0;
   850 			_stringwidth_base = 0;
   853 		}
   851 		}
   854 		sel--;
   852 		sel--;
   855 
   853 
   856 		if ((ord & OT_MASK) == OT_GOTO_STATION) {
   854 		if (sched->type == OT_GOTO_STATION) {
   857 			st = DEREF_STATION(ord >> 8);
   855 			st = DEREF_STATION(sched->station);
   858 
   856 
   859 			if (!(st->had_vehicle_of_type & HVOT_BUOY)) {
   857 			if (!(st->had_vehicle_of_type & HVOT_BUOY)) {
   860 				SetDParam(0, ord >> 8);
   858 				SetDParam(0, sched->station);
   861 				DrawString(x, y, STR_A036, 0);
   859 				DrawString(x, y, STR_A036, 0);
   862 
   860 
   863 				y += 6;
   861 				y += 6;
   864 				if (++i == 4)
   862 				if (++i == 4)
   865 					break;
   863 					break;