(svn r6497) -Fix r6165: Vehicles heading for depots when their orders contained "service in depot" displayed the stopping in depot string
authorbjarni
Fri, 22 Sep 2006 23:13:12 +0000
changeset 4633 cf6c2f173030
parent 4632 1141148a11bf
child 4634 07699ac2bf37
(svn r6497) -Fix r6165: Vehicles heading for depots when their orders contained "service in depot" displayed the stopping in depot string
This turned out to be due to OFB_HALT_IN_DEPOT and OFB_SERVICE_IF_NEEDED using the same bit
It appears that it doesn't matter for the code, so I adapted the string selection code to handle this
aircraft_gui.c
roadveh_gui.c
ship_gui.c
train_gui.c
--- a/aircraft_gui.c	Fri Sep 22 22:15:34 2006 +0000
+++ b/aircraft_gui.c	Fri Sep 22 23:13:12 2006 +0000
@@ -557,7 +557,7 @@
 				/* Aircrafts always go to a station, even if you say depot */
 				SetDParam(0, v->current_order.dest);
 				SetDParam(1, v->cur_speed * 128 / 10);
-				if (HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT)) {
+				if (HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT) && !HASBIT(v->current_order.flags, OFB_PART_OF_ORDERS)) {
 					str = STR_HEADING_FOR_HANGAR + _patches.vehicle_speed;
 				} else {
 					str = STR_HEADING_FOR_HANGAR_SERVICE + _patches.vehicle_speed;
--- a/roadveh_gui.c	Fri Sep 22 22:15:34 2006 +0000
+++ b/roadveh_gui.c	Fri Sep 22 23:13:12 2006 +0000
@@ -343,7 +343,7 @@
 				Depot *depot = GetDepot(v->current_order.dest);
 				SetDParam(0, depot->town_index);
 				SetDParam(1, v->cur_speed / 2);
-				if (HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT)) {
+				if (HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT) && !HASBIT(v->current_order.flags, OFB_PART_OF_ORDERS)) {
 					str = STR_HEADING_FOR_ROAD_DEPOT + _patches.vehicle_speed;
 				} else {
 					str = STR_HEADING_FOR_ROAD_DEPOT_SERVICE + _patches.vehicle_speed;
--- a/ship_gui.c	Fri Sep 22 22:15:34 2006 +0000
+++ b/ship_gui.c	Fri Sep 22 23:13:12 2006 +0000
@@ -484,7 +484,7 @@
 						Depot *depot = GetDepot(v->current_order.dest);
 						SetDParam(0, depot->town_index);
 						SetDParam(1, v->cur_speed / 2);
-						if (HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT)) {
+						if (HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT) && !HASBIT(v->current_order.flags, OFB_PART_OF_ORDERS)) {
 							str = STR_HEADING_FOR_SHIP_DEPOT + _patches.vehicle_speed;
 						} else {
 							str = STR_HEADING_FOR_SHIP_DEPOT_SERVICE + _patches.vehicle_speed;
--- a/train_gui.c	Fri Sep 22 22:15:34 2006 +0000
+++ b/train_gui.c	Fri Sep 22 23:13:12 2006 +0000
@@ -974,7 +974,7 @@
 			case OT_GOTO_DEPOT: {
 				Depot *dep = GetDepot(v->current_order.dest);
 				SetDParam(0, dep->town_index);
-				if (HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT)) {
+				if (HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT) && !HASBIT(v->current_order.flags, OFB_PART_OF_ORDERS)) {
 					str = STR_HEADING_FOR_TRAIN_DEPOT + _patches.vehicle_speed;
 				} else {
 					str = STR_HEADING_FOR_TRAIN_DEPOT_SERVICE + _patches.vehicle_speed;