Changeset - r17683:ed148d83dec5
[Not reviewed]
master
! ! !
planetmaker - 13 years ago 2011-05-18 12:19:58
planetmaker@openttd.org
(svn r22473) -Codechange: Automatic orders are better called implicit orders as no real order influencing path finding is added
65 files changed with 207 insertions and 207 deletions:
0 comments (0 inline, 0 general)
src/ai/api/ai_order.cpp
Show inline comments
 
@@ -66,11 +66,11 @@ static const Order *ResolveOrder(Vehicle
 
		if (order_position == AIOrder::ORDER_INVALID) return NULL;
 
	}
 
	const Order *order = v->orders.list->GetFirstOrder();
 
	while (order->GetType() == OT_AUTOMATIC) order = order->next;
 
	while (order->GetType() == OT_IMPLICIT) order = order->next;
 
	while (order_position > 0) {
 
		order_position = (AIOrder::OrderPosition)(order_position - 1);
 
		order = order->next;
 
		while (order->GetType() == OT_AUTOMATIC) order = order->next;
 
		while (order->GetType() == OT_IMPLICIT) order = order->next;
 
	}
 
	return order;
 
}
 
@@ -135,12 +135,12 @@ static const Order *ResolveOrder(Vehicle
 
		int cur_order_pos = ::Vehicle::Get(vehicle_id)->cur_real_order_index;
 
		const Order *order = ::Vehicle::Get(vehicle_id)->GetOrder(0);
 
		if (order == NULL) return ORDER_INVALID;
 
		int num_automatic_orders = 0;
 
		int num_implicit_orders = 0;
 
		for (int i = 0; i < cur_order_pos; i++) {
 
			if (order->GetType() == OT_AUTOMATIC) num_automatic_orders++;
 
			if (order->GetType() == OT_IMPLICIT) num_implicit_orders++;
 
			order = order->next;
 
		}
 
		return (AIOrder::OrderPosition)(cur_order_pos - num_automatic_orders);
 
		return (AIOrder::OrderPosition)(cur_order_pos - num_implicit_orders);
 
	}
 
	return (order_position >= 0 && order_position < ::Vehicle::Get(vehicle_id)->GetNumManualOrders()) ? order_position : ORDER_INVALID;
 
}
src/ground_vehicle.hpp
Show inline comments
 
@@ -52,7 +52,7 @@ struct GroundVehicleCache {
 
enum GroundVehicleFlags {
 
	GVF_GOINGUP_BIT               = 0,  ///< Vehicle is currently going uphill. (Cached track information for acceleration)
 
	GVF_GOINGDOWN_BIT             = 1,  ///< Vehicle is currently going downhill. (Cached track information for acceleration)
 
	GVF_SUPPRESS_AUTOMATIC_ORDERS = 2,  ///< Disable insertion and removal of automatic orders until the vehicle completes the real order.
 
	GVF_SUPPRESS_IMPLICIT_ORDERS = 2,  ///< Disable insertion and removal of automatic orders until the vehicle completes the real order.
 
};
 

	
 
/**
src/lang/arabic_egypt.txt
Show inline comments
 
@@ -3229,7 +3229,7 @@ STR_ORDER_STOP_ORDER                                            :توقف
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(تلقائى)
 
STR_ORDER_IMPLICIT                                              :(تلقائى)
 

	
 
STR_ORDER_FULL_LOAD                                             :-تحميل بالكامل-
 
STR_ORDER_FULL_LOAD_ANY                                         :-حمل اي بضاعة بالكامل-
src/lang/belarusian.txt
Show inline comments
 
@@ -3593,7 +3593,7 @@ STR_ORDER_STOP_ORDER                                            :(Стоп)
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Аўтаматычна)
 
STR_ORDER_IMPLICIT                                              :(Аўтаматычна)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Поўная загрузка)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Поўная загрузка любым грузам)
src/lang/brazilian_portuguese.txt
Show inline comments
 
@@ -3237,7 +3237,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automatico)
 
STR_ORDER_IMPLICIT                                              :(Automatico)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Carregar completamente)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Carregar completamente qualquer carga)
src/lang/bulgarian.txt
Show inline comments
 
@@ -3222,7 +3222,7 @@ STR_ORDER_STOP_ORDER                                            :(Спри)
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :{G=n}(Автоматично)
 
STR_ORDER_IMPLICIT                                              :{G=n}(Автоматично)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Напълно натовари)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Напълно натовари какъвто и да е товар)
src/lang/catalan.txt
Show inline comments
 
@@ -3237,7 +3237,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automàtic)
 
STR_ORDER_IMPLICIT                                              :(Automàtic)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Carrega del tot)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Carrega del tot qualsevol càrrega)
src/lang/croatian.txt
Show inline comments
 
@@ -3332,7 +3332,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automatsko)
 
STR_ORDER_IMPLICIT                                              :(Automatsko)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Puni ukrcaj)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Puni ukrcaj bilo kojeg tereta)
src/lang/czech.txt
Show inline comments
 
@@ -3324,7 +3324,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(automatický)
 
STR_ORDER_IMPLICIT                                              :(automatický)
 

	
 
STR_ORDER_FULL_LOAD                                             :(plně naložit)
 
STR_ORDER_FULL_LOAD_ANY                                         :(plně naložit cokoli)
src/lang/danish.txt
Show inline comments
 
@@ -3229,7 +3229,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automatisk)
 
STR_ORDER_IMPLICIT                                              :(Automatisk)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Fuld last)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Fuld last vilkårlig type fragt)
src/lang/dutch.txt
Show inline comments
 
@@ -3236,7 +3236,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automatisch)
 
STR_ORDER_IMPLICIT                                              :(Automatisch)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Volledig laden)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Één soort vracht volledig laden)
src/lang/english.txt
Show inline comments
 
@@ -3236,7 +3236,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automatic)
 
STR_ORDER_IMPLICIT                                              :(Automatic)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Full load)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Full load any cargo)
src/lang/english_US.txt
Show inline comments
 
@@ -3236,7 +3236,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automatic)
 
STR_ORDER_IMPLICIT                                              :(Automatic)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Full load)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Full load any cargo)
src/lang/esperanto.txt
Show inline comments
 
@@ -3165,7 +3165,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Aŭtomata)
 
STR_ORDER_IMPLICIT                                              :(Aŭtomata)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Plena Ŝarĝo)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Ŝarĝu ĝis plena ajnan kargon)
src/lang/estonian.txt
Show inline comments
 
@@ -3286,7 +3286,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automaatne)
 
STR_ORDER_IMPLICIT                                              :(Automaatne)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Laaditakse täis)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Ühte kaupa laaditakse täis)
src/lang/finnish.txt
Show inline comments
 
@@ -3236,7 +3236,7 @@ STR_ORDER_STOP_ORDER                                            :(Pysähdy)
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automaattinen)
 
STR_ORDER_IMPLICIT                                              :(Automaattinen)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Täysi lastaus)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Lastaa täyteen mitä tahansa rahtia)
src/lang/french.txt
Show inline comments
 
@@ -3237,7 +3237,7 @@ STR_ORDER_STOP_ORDER                                            :(Arrêt)
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automatique)
 
STR_ORDER_IMPLICIT                                              :(Automatique)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Charger complètement)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Charger complètement par un seul type)
src/lang/german.txt
Show inline comments
 
@@ -3237,7 +3237,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automatisch)
 
STR_ORDER_IMPLICIT                                              :(Automatisch)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Voll beladen)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Mit einer Fracht voll beladen)
src/lang/greek.txt
Show inline comments
 
@@ -3323,7 +3323,7 @@ STR_ORDER_STOP_ORDER                                            :(Στάση)
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Αυτόματο)
 
STR_ORDER_IMPLICIT                                              :(Αυτόματο)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Πλήρης φόρτωση)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Πλήρης φόρτωση οποιουδήποτε εμπορεύματος)
src/lang/hungarian.txt
Show inline comments
 
@@ -3294,7 +3294,7 @@ STR_ORDER_STOP_ORDER                                            :(megáll)
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automata)
 
STR_ORDER_IMPLICIT                                              :(Automata)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Mindenből teljes berakodás)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Bármiből teljes berakodás)
src/lang/indonesian.txt
Show inline comments
 
@@ -3229,7 +3229,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Otomatis)
 
STR_ORDER_IMPLICIT                                              :(Otomatis)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Penuhi Semua)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Penuhi salah satu)
src/lang/irish.txt
Show inline comments
 
@@ -3227,7 +3227,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Uathoibríoch)
 
STR_ORDER_IMPLICIT                                              :(Uathoibríoch)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Lasta iomlán)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Lasta iomlán de lastas ar bith)
src/lang/italian.txt
Show inline comments
 
@@ -3260,7 +3260,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automatico)
 
STR_ORDER_IMPLICIT                                              :(Automatico)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Attendi pieno carico)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Attendi carico)
src/lang/japanese.txt
Show inline comments
 
@@ -3229,7 +3229,7 @@ STR_ORDER_STOP_ORDER                                            :(停止)
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(自動的)
 
STR_ORDER_IMPLICIT                                              :(自動的)
 

	
 
STR_ORDER_FULL_LOAD                                             :(全積載)
 
STR_ORDER_FULL_LOAD_ANY                                         :(いずれか一種の貨物を全積載するまで待つ)
src/lang/korean.txt
Show inline comments
 
@@ -3230,7 +3230,7 @@ STR_ORDER_STOP_ORDER                                            :(멈춤)
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(자동)
 
STR_ORDER_IMPLICIT                                              :(자동)
 

	
 
STR_ORDER_FULL_LOAD                                             :(모든 화물을 가득 실음)
 
STR_ORDER_FULL_LOAD_ANY                                         :(아무 화물이나 가득 싣기)
src/lang/latvian.txt
Show inline comments
 
@@ -3133,7 +3133,7 @@ STR_ORDER_STOP_ORDER                                            :(Apstādināt)
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automātiski)
 
STR_ORDER_IMPLICIT                                              :(Automātiski)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Piekraut pilnu)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Piekraut pilnu ar jebkuru kravu)
src/lang/lithuanian.txt
Show inline comments
 
@@ -3284,7 +3284,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automatinis)
 
STR_ORDER_IMPLICIT                                              :(Automatinis)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Pilnai pasikrauti)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Pilnai pasikrauti, bet kurio krovinio)
src/lang/luxembourgish.txt
Show inline comments
 
@@ -3236,7 +3236,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automatësch)
 
STR_ORDER_IMPLICIT                                              :(Automatësch)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Voll lueden)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Voll lueden mat all Wuer)
src/lang/norwegian_bokmal.txt
Show inline comments
 
@@ -3217,7 +3217,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automatisk)
 
STR_ORDER_IMPLICIT                                              :(Automatisk)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Full last)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Full last av alle varetyper)
src/lang/norwegian_nynorsk.txt
Show inline comments
 
@@ -3219,7 +3219,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automatisk)
 
STR_ORDER_IMPLICIT                                              :(Automatisk)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Last fullt)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Last fullt, vilkårleg last)
src/lang/polish.txt
Show inline comments
 
@@ -3620,7 +3620,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automatycznie)
 
STR_ORDER_IMPLICIT                                              :(Automatycznie)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Pełen załadunek)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Pełen załadunek dowolnego towaru)
src/lang/portuguese.txt
Show inline comments
 
@@ -3231,7 +3231,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automático)
 
STR_ORDER_IMPLICIT                                              :(Automático)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Encher)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Encher de qq. carga)
src/lang/romanian.txt
Show inline comments
 
@@ -3236,7 +3236,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automat)
 
STR_ORDER_IMPLICIT                                              :(Automat)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Încărcare maximă)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Încărcare orice produs)
src/lang/russian.txt
Show inline comments
 
@@ -3422,7 +3422,7 @@ STR_ORDER_STOP_ORDER                                            :(Стоп)
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Автоматически)
 
STR_ORDER_IMPLICIT                                              :(Автоматически)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Полная погрузка)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Полная погрузка любым грузом)
src/lang/serbian.txt
Show inline comments
 
@@ -3447,7 +3447,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automatski)
 
STR_ORDER_IMPLICIT                                              :(Automatski)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Pun utovar)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Pun utovar bilo kog)
src/lang/simplified_chinese.txt
Show inline comments
 
@@ -3224,7 +3224,7 @@ STR_ORDER_STOP_ORDER                                            :(停留)
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(自动)
 
STR_ORDER_IMPLICIT                                              :(自动)
 

	
 
STR_ORDER_FULL_LOAD                                             :(装满全部货物)
 
STR_ORDER_FULL_LOAD_ANY                                         :(装满任意货物后离开)
src/lang/slovak.txt
Show inline comments
 
@@ -3296,7 +3296,7 @@ STR_ORDER_STOP_ORDER                                            :(Zastaviť)
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automaticky)
 
STR_ORDER_IMPLICIT                                              :(Automaticky)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Plne nalož)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Plne nalož akýkoľvek náklad)
src/lang/slovenian.txt
Show inline comments
 
@@ -3383,7 +3383,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Avtomatično)
 
STR_ORDER_IMPLICIT                                              :(Avtomatično)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Napolni)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Napolni kakršenkoli tovor)
src/lang/spanish.txt
Show inline comments
 
@@ -3237,7 +3237,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automática)
 
STR_ORDER_IMPLICIT                                              :(Automática)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Carga completa)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Carga completa cualquier carga)
src/lang/swedish.txt
Show inline comments
 
@@ -3232,7 +3232,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automatisk)
 
STR_ORDER_IMPLICIT                                              :(Automatisk)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Full last)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Full last någon godstyp)
src/lang/traditional_chinese.txt
Show inline comments
 
@@ -3229,7 +3229,7 @@ STR_ORDER_STOP_ORDER                                            :(停止)
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(自動)
 
STR_ORDER_IMPLICIT                                              :(自動)
 

	
 
STR_ORDER_FULL_LOAD                                             :(滿載)
 
STR_ORDER_FULL_LOAD_ANY                                         :(滿載任一種類客貨)
src/lang/turkish.txt
Show inline comments
 
@@ -3223,7 +3223,7 @@ STR_ORDER_STOP_ORDER                    
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Otomatik)
 
STR_ORDER_IMPLICIT                                              :(Otomatik)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Tam yükle)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Bir kargoyu tam yükle)
src/lang/ukrainian.txt
Show inline comments
 
@@ -3354,7 +3354,7 @@ STR_ORDER_STOP_ORDER                                            :(зупинити)
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Автоматично)
 
STR_ORDER_IMPLICIT                                              :(Автоматично)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Завантажити все)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Повністю завантажити будь-який вид вантажу)
src/lang/unfinished/basque.txt
Show inline comments
 
@@ -1780,7 +1780,7 @@ STR_ORDER_GO_TO_DEPOT_FORMAT            
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Automatikoa)
 
STR_ORDER_IMPLICIT                                              :(Automatikoa)
 

	
 

	
 

	
src/lang/unfinished/frisian.txt
Show inline comments
 
@@ -2381,7 +2381,7 @@ STR_ORDER_GO_NON_STOP_TO_WAYPOINT                               :Oanienwei lâns {WAYPOINT}
 

	
 

	
 

	
 
STR_ORDER_AUTOMATIC                                             :( Automatysk)
 
STR_ORDER_IMPLICIT                                              :( Automatysk)
 

	
 
STR_ORDER_NO_UNLOAD_NO_LOAD                                     :(net lade of losse)
 

	
src/lang/unfinished/maltese.txt
Show inline comments
 
@@ -798,7 +798,7 @@ STR_ORDERS_DELETE_ALL_TOOLTIP           
 

	
 

	
 

	
 
STR_ORDER_AUTOMATIC                                             :(Awtomatiku)
 
STR_ORDER_IMPLICIT                                              :(Awtomatiku)
 

	
 

	
 

	
src/lang/unfinished/marathi.txt
Show inline comments
 
@@ -1177,7 +1177,7 @@ STR_ORDERS_DELETE_ALL_TOOLTIP                                   :{BLACK}सर्व आदेश रद्द करा
 

	
 

	
 

	
 
STR_ORDER_AUTOMATIC                                             :(आपोआप)
 
STR_ORDER_IMPLICIT                                              :(आपोआप)
 

	
 

	
 

	
src/lang/unfinished/tamil.txt
Show inline comments
 
@@ -1008,7 +1008,7 @@ STR_ORDERS_DELETE_ALL_TOOLTIP                                   :{BLACK}அனைத்து ஆர்டர்களையும் ரத்து செய்
 

	
 

	
 

	
 
STR_ORDER_AUTOMATIC                                             :(தானியங்கி)
 
STR_ORDER_IMPLICIT                                              :(தானியங்கி)
 

	
 
STR_ORDER_NO_UNLOAD_NO_LOAD                                     :(லோடிங் அன்லோடிங் தடைசெய்யப்பட்டுள்ளது)
 

	
src/lang/unfinished/thai.txt
Show inline comments
 
@@ -2527,7 +2527,7 @@ STR_ORDERS_DELETE_ALL_TOOLTIP                                   :{BLACK}ลบคำสั่งทั้งหมด
 

	
 

	
 

	
 
STR_ORDER_AUTOMATIC                                             :(อัตโนมัติ)
 
STR_ORDER_IMPLICIT                                              :(อัตโนมัติ)
 

	
 
STR_ORDER_NO_UNLOAD_NO_LOAD                                     :(ไม่มีการขนถ่ายสินค้า)
 

	
src/lang/vietnamese.txt
Show inline comments
 
@@ -3233,7 +3233,7 @@ STR_ORDER_STOP_ORDER                                            :(Dừng)
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING}
 

	
 
STR_ORDER_AUTOMATIC                                             :(Tự động)
 
STR_ORDER_IMPLICIT                                              :(Tự động)
 

	
 
STR_ORDER_FULL_LOAD                                             :(Bốc đầy hàng)
 
STR_ORDER_FULL_LOAD_ANY                                         :(Bốc đủ bất kỳ hàng nào)
src/order_backup.cpp
Show inline comments
 
@@ -44,7 +44,7 @@ OrderBackup::OrderBackup(const Vehicle *
 
{
 
	this->user             = user;
 
	this->tile             = v->tile;
 
	this->orderindex       = v->cur_auto_order_index;
 
	this->orderindex       = v->cur_implicit_order_index;
 
	this->group            = v->group_id;
 
	this->service_interval = v->service_interval;
 

	
 
@@ -88,7 +88,7 @@ void OrderBackup::DoRestore(Vehicle *v)
 

	
 
	uint num_orders = v->GetNumOrders();
 
	if (num_orders != 0) {
 
		v->cur_real_order_index = v->cur_auto_order_index = this->orderindex % num_orders;
 
		v->cur_real_order_index = v->cur_implicit_order_index = this->orderindex % num_orders;
 
		v->UpdateRealOrderIndex();
 
	}
 
	v->service_interval = this->service_interval;
src/order_base.h
Show inline comments
 
@@ -77,7 +77,7 @@ public:
 
	void MakeLeaveStation();
 
	void MakeDummy();
 
	void MakeConditional(VehicleOrderID order);
 
	void MakeAutomatic(StationID destination);
 
	void MakeImplicit(StationID destination);
 

	
 
	/**
 
	 * Gets the destination of this order.
src/order_cmd.cpp
Show inline comments
 
@@ -134,12 +134,12 @@ void Order::MakeConditional(VehicleOrder
 
}
 

	
 
/**
 
 * Makes this order an automatic order.
 
 * Makes this order an implicit order.
 
 * @param destination the station to go to.
 
 */
 
void Order::MakeAutomatic(StationID destination)
 
void Order::MakeImplicit(StationID destination)
 
{
 
	this->type = OT_AUTOMATIC;
 
	this->type = OT_IMPLICIT;
 
	this->dest = destination;
 
}
 

	
 
@@ -288,7 +288,7 @@ void OrderList::Initialize(Order *chain,
 

	
 
	for (Order *o = this->first; o != NULL; o = o->next) {
 
		++this->num_orders;
 
		if (!o->IsType(OT_AUTOMATIC)) ++this->num_manual_orders;
 
		if (!o->IsType(OT_IMPLICIT)) ++this->num_manual_orders;
 
		this->timetable_duration += o->wait_time + o->travel_time;
 
	}
 

	
 
@@ -365,7 +365,7 @@ void OrderList::InsertOrderAt(Order *new
 
		}
 
	}
 
	++this->num_orders;
 
	if (!new_order->IsType(OT_AUTOMATIC)) ++this->num_manual_orders;
 
	if (!new_order->IsType(OT_IMPLICIT)) ++this->num_manual_orders;
 
	this->timetable_duration += new_order->wait_time + new_order->travel_time;
 
}
 

	
 
@@ -389,7 +389,7 @@ void OrderList::DeleteOrderAt(int index)
 
		prev->next = to_remove->next;
 
	}
 
	--this->num_orders;
 
	if (!to_remove->IsType(OT_AUTOMATIC)) --this->num_manual_orders;
 
	if (!to_remove->IsType(OT_IMPLICIT)) --this->num_manual_orders;
 
	this->timetable_duration -= (to_remove->wait_time + to_remove->travel_time);
 
	delete to_remove;
 
}
 
@@ -469,8 +469,8 @@ int OrderList::GetPositionInSharedOrderL
 
bool OrderList::IsCompleteTimetable() const
 
{
 
	for (Order *o = this->first; o != NULL; o = o->next) {
 
		/* Automatic orders are, by definition, not timetabled. */
 
		if (o->IsType(OT_AUTOMATIC)) continue;
 
		/* Implicit orders are, by definition, not timetabled. */
 
		if (o->IsType(OT_IMPLICIT)) continue;
 
		if (!o->IsCompletelyTimetabled()) return false;
 
	}
 
	return true;
 
@@ -490,7 +490,7 @@ void OrderList::DebugCheckSanity() const
 

	
 
	for (const Order *o = this->first; o != NULL; o = o->next) {
 
		++check_num_orders;
 
		if (!o->IsType(OT_AUTOMATIC)) ++check_num_manual_orders;
 
		if (!o->IsType(OT_IMPLICIT)) ++check_num_manual_orders;
 
		check_timetable_duration += o->wait_time + o->travel_time;
 
	}
 
	assert(this->num_orders == check_num_orders);
 
@@ -544,7 +544,7 @@ TileIndex Order::GetLocation(const Vehic
 
	switch (this->GetType()) {
 
		case OT_GOTO_WAYPOINT:
 
		case OT_GOTO_STATION:
 
		case OT_AUTOMATIC:
 
		case OT_IMPLICIT:
 
			return BaseStation::Get(this->GetDestination())->xy;
 

	
 
		case OT_GOTO_DEPOT:
 
@@ -820,8 +820,8 @@ void InsertOrder(Vehicle *v, Order *new_
 
		assert(v->orders.list == u->orders.list);
 

	
 
		/* If there is added an order before the current one, we need
 
		 * to update the selected order. We do not change automatic/real order indices though.
 
		 * If the new order is between the current auto order and real order, the auto order will
 
		 * to update the selected order. We do not change implicit/real order indices though.
 
		 * If the new order is between the current implicit order and real order, the implicit order will
 
		 * later skip the inserted order. */
 
		if (sel_ord <= u->cur_real_order_index) {
 
			uint cur = u->cur_real_order_index + 1;
 
@@ -830,18 +830,18 @@ void InsertOrder(Vehicle *v, Order *new_
 
				u->cur_real_order_index = cur;
 
			}
 
		}
 
		if (sel_ord == u->cur_auto_order_index && u->IsGroundVehicle()) {
 
			/* We are inserting an order just before the current automatic order.
 
			 * We do not know whether we will reach current automatic or the newly inserted order first.
 
			 * So, disable creation of automatic orders until we are on track again. */
 
		if (sel_ord == u->cur_implicit_order_index && u->IsGroundVehicle()) {
 
			/* We are inserting an order just before the current implicit order.
 
			 * We do not know whether we will reach current implicit or the newly inserted order first.
 
			 * So, disable creation of implicit orders until we are on track again. */
 
			uint16 &gv_flags = u->GetGroundVehicleFlags();
 
			SetBit(gv_flags, GVF_SUPPRESS_AUTOMATIC_ORDERS);
 
			SetBit(gv_flags, GVF_SUPPRESS_IMPLICIT_ORDERS);
 
		}
 
		if (sel_ord <= u->cur_auto_order_index) {
 
			uint cur = u->cur_auto_order_index + 1;
 
		if (sel_ord <= u->cur_implicit_order_index) {
 
			uint cur = u->cur_implicit_order_index + 1;
 
			/* Check if we don't go out of bound */
 
			if (cur < u->GetNumOrders()) {
 
				u->cur_auto_order_index = cur;
 
				u->cur_implicit_order_index = cur;
 
			}
 
		}
 
		/* Update any possible open window of the vehicle */
 
@@ -952,16 +952,16 @@ void DeleteOrder(Vehicle *v, VehicleOrde
 
			u->UpdateRealOrderIndex();
 
		}
 

	
 
		if (sel_ord < u->cur_auto_order_index) {
 
			u->cur_auto_order_index--;
 
		} else if (sel_ord == u->cur_auto_order_index) {
 
		if (sel_ord < u->cur_implicit_order_index) {
 
			u->cur_implicit_order_index--;
 
		} else if (sel_ord == u->cur_implicit_order_index) {
 
			/* Make sure the index is valid */
 
			if (u->cur_auto_order_index >= u->GetNumOrders()) u->cur_auto_order_index = 0;
 
			if (u->cur_implicit_order_index >= u->GetNumOrders()) u->cur_implicit_order_index = 0;
 

	
 
			/* Skip non-automatic orders for the auto-order-index (e.g. if the current auto order was deleted */
 
			while (u->cur_auto_order_index != u->cur_real_order_index && !u->GetOrder(u->cur_auto_order_index)->IsType(OT_AUTOMATIC)) {
 
				u->cur_auto_order_index++;
 
				if (u->cur_auto_order_index >= u->GetNumOrders()) u->cur_auto_order_index = 0;
 
			/* Skip non-implicit orders for the implicit-order-index (e.g. if the current implicit order was deleted */
 
			while (u->cur_implicit_order_index != u->cur_real_order_index && !u->GetOrder(u->cur_implicit_order_index)->IsType(OT_IMPLICIT)) {
 
				u->cur_implicit_order_index++;
 
				if (u->cur_implicit_order_index >= u->GetNumOrders()) u->cur_implicit_order_index = 0;
 
			}
 
		}
 

	
 
@@ -1005,13 +1005,13 @@ CommandCost CmdSkipToOrder(TileIndex til
 

	
 
	Vehicle *v = Vehicle::GetIfValid(veh_id);
 

	
 
	if (v == NULL || !v->IsPrimaryVehicle() || sel_ord == v->cur_auto_order_index || sel_ord >= v->GetNumOrders() || v->GetNumOrders() < 2) return CMD_ERROR;
 
	if (v == NULL || !v->IsPrimaryVehicle() || sel_ord == v->cur_implicit_order_index || sel_ord >= v->GetNumOrders() || v->GetNumOrders() < 2) return CMD_ERROR;
 

	
 
	CommandCost ret = CheckOwnership(v->owner);
 
	if (ret.Failed()) return ret;
 

	
 
	if (flags & DC_EXEC) {
 
		v->cur_auto_order_index = v->cur_real_order_index = sel_ord;
 
		v->cur_implicit_order_index = v->cur_real_order_index = sel_ord;
 
		v->UpdateRealOrderIndex();
 

	
 
		if (v->current_order.IsType(OT_LOADING)) v->LeaveStation();
 
@@ -1069,7 +1069,7 @@ CommandCost CmdMoveOrder(TileIndex tile,
 

	
 
		for (; u != NULL; u = u->NextShared()) {
 
			/* Update the current order.
 
			 * There are multiple ways to move orders, which result in cur_auto_order_index
 
			 * There are multiple ways to move orders, which result in cur_implicit_order_index
 
			 * and cur_real_order_index to not longer make any sense. E.g. moving another
 
			 * real order between them.
 
			 *
 
@@ -1079,10 +1079,10 @@ CommandCost CmdMoveOrder(TileIndex tile,
 
			 * However, from an AI point of view, preserving cur_real_order_index is the most
 
			 * predictable and transparent behaviour.
 
			 *
 
			 * With that decision it basically does not matter what we do to cur_auto_order_index.
 
			 * If we change orders between the auto- and real-index, the auto orders are mostly likely
 
			 * completely out-dated anyway. So, keep it simple and just keep cur_auto_order_index as well.
 
			 * The worst which can happen is that a lot of automatic orders are removed when reaching current_order.
 
			 * With that decision it basically does not matter what we do to cur_implicit_order_index.
 
			 * If we change orders between the implict- and real-index, the implicit orders are mostly likely
 
			 * completely out-dated anyway. So, keep it simple and just keep cur_implicit_order_index as well.
 
			 * The worst which can happen is that a lot of implicit orders are removed when reaching current_order.
 
			 */
 
			if (u->cur_real_order_index == moving_order) {
 
				u->cur_real_order_index = target_order;
 
@@ -1092,12 +1092,12 @@ CommandCost CmdMoveOrder(TileIndex tile,
 
				u->cur_real_order_index++;
 
			}
 

	
 
			if (u->cur_auto_order_index == moving_order) {
 
				u->cur_auto_order_index = target_order;
 
			} else if (u->cur_auto_order_index > moving_order && u->cur_auto_order_index <= target_order) {
 
				u->cur_auto_order_index--;
 
			} else if (u->cur_auto_order_index < moving_order && u->cur_auto_order_index >= target_order) {
 
				u->cur_auto_order_index++;
 
			if (u->cur_implicit_order_index == moving_order) {
 
				u->cur_implicit_order_index = target_order;
 
			} else if (u->cur_implicit_order_index > moving_order && u->cur_implicit_order_index <= target_order) {
 
				u->cur_implicit_order_index--;
 
			} else if (u->cur_implicit_order_index < moving_order && u->cur_implicit_order_index >= target_order) {
 
				u->cur_implicit_order_index++;
 
			}
 

	
 
			assert(v->orders.list == u->orders.list);
 
@@ -1650,12 +1650,12 @@ restart:
 

	
 
			OrderType ot = order->GetType();
 
			if (ot == OT_GOTO_DEPOT && (order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) != 0) continue;
 
			if (ot == OT_AUTOMATIC || (v->type == VEH_AIRCRAFT && ot == OT_GOTO_DEPOT)) ot = OT_GOTO_STATION;
 
			if (ot == OT_IMPLICIT || (v->type == VEH_AIRCRAFT && ot == OT_GOTO_DEPOT)) ot = OT_GOTO_STATION;
 
			if (ot == type && order->GetDestination() == destination) {
 
				/* We want to clear automatic orders, but we don't want to make them
 
				/* We want to clear implicit orders, but we don't want to make them
 
				 * dummy orders. They should just vanish. Also check the actual order
 
				 * type as ot is currently OT_GOTO_STATION. */
 
				if (order->IsType(OT_AUTOMATIC)) {
 
				if (order->IsType(OT_IMPLICIT)) {
 
					order = order->next; // DeleteOrder() invalidates current order
 
					DeleteOrder(v, id);
 
					if (order != NULL) goto restart;
 
@@ -1692,7 +1692,7 @@ bool Vehicle::HasDepotOrder() const
 
 * Delete all orders from a vehicle
 
 * @param v                   Vehicle whose orders to reset
 
 * @param keep_orderlist      If true, do not free the order list, only empty it.
 
 * @param reset_order_indices If true, reset cur_auto_order_index and cur_real_order_index
 
 * @param reset_order_indices If true, reset cur_implicit_order_index and cur_real_order_index
 
 *                            and cancel the current full load order (if the vehicle is loading).
 
 *                            If false, _you_ have to make sure the order indices are valid after
 
 *                            your messing with them!
 
@@ -1712,7 +1712,7 @@ void DeleteVehicleOrders(Vehicle *v, boo
 
	}
 

	
 
	if (reset_order_indices) {
 
		v->cur_auto_order_index = v->cur_real_order_index = 0;
 
		v->cur_implicit_order_index = v->cur_real_order_index = 0;
 
		if (v->current_order.IsType(OT_LOADING)) {
 
			CancelLoadingDueToDeletedOrder(v);
 
		}
 
@@ -1866,18 +1866,18 @@ bool UpdateOrderDest(Vehicle *v, const O
 
		case OT_CONDITIONAL: {
 
			VehicleOrderID next_order = ProcessConditionalOrder(order, v);
 
			if (next_order != INVALID_VEH_ORDER_ID) {
 
				/* Jump to next_order. cur_auto_order_index becomes exactly that order,
 
				/* Jump to next_order. cur_implicit_order_index becomes exactly that order,
 
				 * cur_real_order_index might come after next_order. */
 
				UpdateVehicleTimetable(v, false);
 
				v->cur_auto_order_index = v->cur_real_order_index = next_order;
 
				v->cur_implicit_order_index = v->cur_real_order_index = next_order;
 
				v->UpdateRealOrderIndex();
 
				v->current_order_time += v->GetOrder(v->cur_real_order_index)->travel_time;
 

	
 
				/* Disable creation of automatic orders.
 
				/* Disable creation of implicit orders.
 
				 * When inserting them we do not know that we would have to make the conditional orders point to them. */
 
				if (v->IsGroundVehicle()) {
 
					uint16 &gv_flags = v->GetGroundVehicleFlags();
 
					SetBit(gv_flags, GVF_SUPPRESS_AUTOMATIC_ORDERS);
 
					SetBit(gv_flags, GVF_SUPPRESS_IMPLICIT_ORDERS);
 
				}
 
			} else {
 
				UpdateVehicleTimetable(v, true);
 
@@ -1891,12 +1891,12 @@ bool UpdateOrderDest(Vehicle *v, const O
 
			return false;
 
	}
 

	
 
	assert(v->cur_auto_order_index < v->GetNumOrders());
 
	assert(v->cur_implicit_order_index < v->GetNumOrders());
 
	assert(v->cur_real_order_index < v->GetNumOrders());
 

	
 
	/* Get the current order */
 
	order = v->GetOrder(v->cur_real_order_index);
 
	if (order != NULL && order->IsType(OT_AUTOMATIC)) {
 
	if (order != NULL && order->IsType(OT_IMPLICIT)) {
 
		assert(v->GetNumManualOrders() == 0);
 
		order = NULL;
 
	}
 
@@ -1949,22 +1949,22 @@ bool ProcessOrders(Vehicle *v)
 
	if (((v->current_order.IsType(OT_GOTO_STATION) && (v->current_order.GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION)) || v->current_order.IsType(OT_GOTO_WAYPOINT)) &&
 
			IsTileType(v->tile, MP_STATION) &&
 
			v->current_order.GetDestination() == GetStationIndex(v->tile)) {
 
		v->DeleteUnreachedAutoOrders();
 
		v->DeleteUnreachedImplicitOrders();
 
		/* We set the last visited station here because we do not want
 
		 * the train to stop at this 'via' station if the next order
 
		 * is a no-non-stop order; in that case not setting the last
 
		 * visited station will cause the vehicle to still stop. */
 
		v->last_station_visited = v->current_order.GetDestination();
 
		UpdateVehicleTimetable(v, true);
 
		v->IncrementAutoOrderIndex();
 
		v->IncrementImplicitOrderIndex();
 
	}
 

	
 
	/* Get the current order */
 
	assert(v->cur_auto_order_index == 0 || v->cur_auto_order_index < v->GetNumOrders());
 
	assert(v->cur_implicit_order_index == 0 || v->cur_implicit_order_index < v->GetNumOrders());
 
	v->UpdateRealOrderIndex();
 

	
 
	const Order *order = v->GetOrder(v->cur_real_order_index);
 
	if (order != NULL && order->IsType(OT_AUTOMATIC)) {
 
	if (order != NULL && order->IsType(OT_IMPLICIT)) {
 
		assert(v->GetNumManualOrders() == 0);
 
		order = NULL;
 
	}
src/order_gui.cpp
Show inline comments
 
@@ -198,12 +198,12 @@ void DrawOrderString(const Vehicle *v, c
 
	if (v->cur_real_order_index == order_index) {
 
		DrawSprite(sprite, PAL_NONE, rtl ? right -     sprite_size.width : left,                     y + ((int)FONT_HEIGHT_NORMAL - (int)sprite_size.height) / 2);
 
		DrawSprite(sprite, PAL_NONE, rtl ? right - 2 * sprite_size.width : left + sprite_size.width, y + ((int)FONT_HEIGHT_NORMAL - (int)sprite_size.height) / 2);
 
	} else if (v->cur_auto_order_index == order_index) {
 
	} else if (v->cur_implicit_order_index == order_index) {
 
		DrawSprite(sprite, PAL_NONE, rtl ? right -     sprite_size.width : left,                     y + ((int)FONT_HEIGHT_NORMAL - (int)sprite_size.height) / 2);
 
	}
 

	
 
	TextColour colour = TC_BLACK;
 
	if (order->IsType(OT_AUTOMATIC)) {
 
	if (order->IsType(OT_IMPLICIT)) {
 
		colour = (selected ? TC_SILVER : TC_GREY) | TC_NO_SHADE;
 
	} else if (selected) {
 
		colour = TC_WHITE;
 
@@ -220,11 +220,11 @@ void DrawOrderString(const Vehicle *v, c
 
			SetDParam(1, order->GetDestination());
 
			break;
 

	
 
		case OT_AUTOMATIC:
 
		case OT_IMPLICIT:
 
			SetDParam(0, STR_ORDER_GO_TO_STATION);
 
			SetDParam(1, STR_ORDER_GO_TO);
 
			SetDParam(2, order->GetDestination());
 
			SetDParam(3, timetable ? STR_EMPTY : STR_ORDER_AUTOMATIC);
 
			SetDParam(3, timetable ? STR_EMPTY : STR_ORDER_IMPLICIT);
 
			break;
 

	
 
		case OT_GOTO_STATION: {
 
@@ -685,10 +685,10 @@ private:
 
	void OrderClick_Skip(int i)
 
	{
 
		/* Don't skip when there's nothing to skip */
 
		if (_ctrl_pressed && this->vehicle->cur_auto_order_index == this->OrderGetSel()) return;
 
		if (_ctrl_pressed && this->vehicle->cur_implicit_order_index == this->OrderGetSel()) return;
 
		if (this->vehicle->GetNumOrders() <= 1) return;
 

	
 
		DoCommandP(this->vehicle->tile, this->vehicle->index, _ctrl_pressed ? this->OrderGetSel() : ((this->vehicle->cur_auto_order_index + 1) % this->vehicle->GetNumOrders()),
 
		DoCommandP(this->vehicle->tile, this->vehicle->index, _ctrl_pressed ? this->OrderGetSel() : ((this->vehicle->cur_implicit_order_index + 1) % this->vehicle->GetNumOrders()),
 
				CMD_SKIP_TO_ORDER | CMD_MSG(_ctrl_pressed ? STR_ERROR_CAN_T_SKIP_TO_ORDER : STR_ERROR_CAN_T_SKIP_ORDER));
 
	}
 

	
src/order_type.h
Show inline comments
 
@@ -38,7 +38,7 @@ enum OrderType {
 
	OT_DUMMY         = 5,
 
	OT_GOTO_WAYPOINT = 6,
 
	OT_CONDITIONAL   = 7,
 
	OT_AUTOMATIC     = 8,
 
	OT_IMPLICIT     = 8,
 
	OT_END
 
};
 

	
src/roadveh_cmd.cpp
Show inline comments
 
@@ -1580,7 +1580,7 @@ static void CheckIfRoadVehNeedsService(R
 
		return;
 
	}
 

	
 
	SetBit(v->gv_flags, GVF_SUPPRESS_AUTOMATIC_ORDERS);
 
	SetBit(v->gv_flags, GVF_SUPPRESS_IMPLICIT_ORDERS);
 
	v->current_order.MakeGoToDepot(depot, ODTFB_SERVICE);
 
	v->dest_tile = rfdd.tile;
 
	SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
src/saveload/afterload.cpp
Show inline comments
 
@@ -2565,9 +2565,9 @@ bool AfterLoadGame()
 
			if (!v->IsPrimaryVehicle()) continue;
 

	
 
			/* Older versions are less strict with indices being in range and fix them on the fly */
 
			if (v->cur_auto_order_index >= v->GetNumOrders()) v->cur_auto_order_index = 0;
 
			if (v->cur_implicit_order_index >= v->GetNumOrders()) v->cur_implicit_order_index = 0;
 

	
 
			v->cur_real_order_index = v->cur_auto_order_index;
 
			v->cur_real_order_index = v->cur_implicit_order_index;
 
			v->UpdateRealOrderIndex();
 
		}
 
	}
src/saveload/oldloader_sl.cpp
Show inline comments
 
@@ -1141,7 +1141,7 @@ static const OldChunks vehicle_chunk[] =
 
	OCL_VAR ( OC_UINT16,   1, &_old_order ),
 

	
 
	OCL_NULL ( 1 ), ///< num_orders, now calculated
 
	OCL_SVAR(  OC_UINT8, Vehicle, cur_auto_order_index ),
 
	OCL_SVAR(  OC_UINT8, Vehicle, cur_implicit_order_index ),
 
	OCL_SVAR(   OC_TILE, Vehicle, dest_tile ),
 
	OCL_SVAR( OC_UINT16, Vehicle, load_unload_ticks ),
 
	OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Vehicle, date_of_last_service ),
src/saveload/vehicle_sl.cpp
Show inline comments
 
@@ -504,7 +504,7 @@ const SaveLoad *GetVehicleDescription(Ve
 
		     SLE_VAR(Vehicle, tick_counter,          SLE_UINT8),
 
		 SLE_CONDVAR(Vehicle, running_ticks,         SLE_UINT8,                   88, SL_MAX_VERSION),
 

	
 
		     SLE_VAR(Vehicle, cur_auto_order_index,  SLE_UINT8),
 
		     SLE_VAR(Vehicle, cur_implicit_order_index,  SLE_UINT8),
 
		 SLE_CONDVAR(Vehicle, cur_real_order_index,  SLE_UINT8,                  158, SL_MAX_VERSION),
 
		/* num_orders is now part of OrderList and is not saved but counted */
 
		SLE_CONDNULL(1,                                                            0, 104),
src/timetable_cmd.cpp
Show inline comments
 
@@ -77,7 +77,7 @@ CommandCost CmdChangeTimetable(TileIndex
 

	
 
	VehicleOrderID order_number = GB(p1, 20, 8);
 
	Order *order = v->GetOrder(order_number);
 
	if (order == NULL || order->IsType(OT_AUTOMATIC)) return CMD_ERROR;
 
	if (order == NULL || order->IsType(OT_IMPLICIT)) return CMD_ERROR;
 

	
 
	bool is_journey = HasBit(p1, 28);
 

	
 
@@ -241,10 +241,10 @@ void UpdateVehicleTimetable(Vehicle *v, 
 

	
 
	v->current_order_time = 0;
 

	
 
	if (v->current_order.IsType(OT_AUTOMATIC)) return; // no timetabling of auto orders
 
	if (v->current_order.IsType(OT_IMPLICIT)) return; // no timetabling of auto orders
 

	
 
	VehicleOrderID first_manual_order = 0;
 
	for (Order *o = v->GetFirstOrder(); o != NULL && o->IsType(OT_AUTOMATIC); o = o->next) {
 
	for (Order *o = v->GetFirstOrder(); o != NULL && o->IsType(OT_IMPLICIT); o = o->next) {
 
		++first_manual_order;
 
	}
 

	
src/timetable_gui.cpp
Show inline comments
 
@@ -90,7 +90,7 @@ static void SetArrivalDepartParams(int p
 
static bool CanDetermineTimeTaken(const Order *order, bool travelling)
 
{
 
	/* Current order is conditional */
 
	if (order->IsType(OT_CONDITIONAL) || order->IsType(OT_AUTOMATIC)) return false;
 
	if (order->IsType(OT_CONDITIONAL) || order->IsType(OT_IMPLICIT)) return false;
 
	/* No travel time and we have not already finished travelling */
 
	if (travelling && order->travel_time == 0) return false;
 
	/* No wait time but we are loading at this timetabled station */
 
@@ -128,8 +128,8 @@ static void FillTimetableArrivalDepartur
 
	do {
 
		/* Automatic orders don't influence the overall timetable;
 
		 * they just add some untimetabled entries, but the time till
 
		 * the next non-automatic order can still be known. */
 
		if (!order->IsType(OT_AUTOMATIC)) {
 
		 * the next non-implicit order can still be known. */
 
		if (!order->IsType(OT_IMPLICIT)) {
 
			if (travelling || i != start) {
 
				if (!CanDetermineTimeTaken(order, true)) return;
 
				sum += order->travel_time;
 
@@ -330,7 +330,7 @@ struct TimetableWindow : Window {
 
			if (selected != -1) {
 
				const Order *order = v->GetOrder(((selected + 1) / 2) % v->GetNumOrders());
 
				if (selected % 2 == 1) {
 
					disable = order != NULL && (order->IsType(OT_CONDITIONAL) || order->IsType(OT_AUTOMATIC));
 
					disable = order != NULL && (order->IsType(OT_CONDITIONAL) || order->IsType(OT_IMPLICIT));
 
				} else {
 
					disable = order == NULL || ((!order->IsType(OT_GOTO_STATION) || (order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION)) && !order->IsType(OT_CONDITIONAL));
 
				}
 
@@ -403,7 +403,7 @@ struct TimetableWindow : Window {
 
						TextColour colour = (i == selected) ? TC_WHITE : TC_BLACK;
 
						if (order->IsType(OT_CONDITIONAL)) {
 
							string = STR_TIMETABLE_NO_TRAVEL;
 
						} else if (order->IsType(OT_AUTOMATIC)) {
 
						} else if (order->IsType(OT_IMPLICIT)) {
 
							string = STR_TIMETABLE_NOT_TIMETABLEABLE;
 
							colour = ((i == selected) ? TC_SILVER : TC_GREY) | TC_NO_SHADE;
 
						} else if (order->travel_time == 0) {
src/train_cmd.cpp
Show inline comments
 
@@ -2292,7 +2292,7 @@ private:
 
	TileIndex      old_dest_tile;
 
	StationID      old_last_station_visited;
 
	VehicleOrderID index;
 
	bool           suppress_automatic_orders;
 
	bool           suppress_implicit_orders;
 

	
 
public:
 
	VehicleOrderSaver(Train *_v) :
 
@@ -2301,7 +2301,7 @@ public:
 
		old_dest_tile(_v->dest_tile),
 
		old_last_station_visited(_v->last_station_visited),
 
		index(_v->cur_real_order_index),
 
		suppress_automatic_orders(HasBit(_v->gv_flags, GVF_SUPPRESS_AUTOMATIC_ORDERS))
 
		suppress_implicit_orders(HasBit(_v->gv_flags, GVF_SUPPRESS_IMPLICIT_ORDERS))
 
	{
 
	}
 

	
 
@@ -2310,7 +2310,7 @@ public:
 
		this->v->current_order = this->old_order;
 
		this->v->dest_tile = this->old_dest_tile;
 
		this->v->last_station_visited = this->old_last_station_visited;
 
		SB(this->v->gv_flags, GVF_SUPPRESS_AUTOMATIC_ORDERS, 1, suppress_automatic_orders ? 1: 0);
 
		SB(this->v->gv_flags, GVF_SUPPRESS_IMPLICIT_ORDERS, 1, suppress_implicit_orders ? 1: 0);
 
	}
 

	
 
	/**
 
@@ -3770,7 +3770,7 @@ static void CheckIfTrainNeedsService(Tra
 
		return;
 
	}
 

	
 
	SetBit(v->gv_flags, GVF_SUPPRESS_AUTOMATIC_ORDERS);
 
	SetBit(v->gv_flags, GVF_SUPPRESS_IMPLICIT_ORDERS);
 
	v->current_order.MakeGoToDepot(depot, ODTFB_SERVICE);
 
	v->dest_tile = tfdd.tile;
 
	SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
src/vehicle.cpp
Show inline comments
 
@@ -1301,9 +1301,9 @@ void VehicleEnterDepot(Vehicle *v)
 

	
 
		if (t.GetDepotOrderType() & ODTFB_PART_OF_ORDERS) {
 
			/* Part of orders */
 
			v->DeleteUnreachedAutoOrders();
 
			v->DeleteUnreachedImplicitOrders();
 
			UpdateVehicleTimetable(v, true);
 
			v->IncrementAutoOrderIndex();
 
			v->IncrementImplicitOrderIndex();
 
		}
 
		if (t.GetDepotActionType() & ODATFB_HALT) {
 
			/* Vehicles are always stopped on entering depots. Do not restart this one. */
 
@@ -1793,39 +1793,39 @@ uint GetVehicleCapacity(const Vehicle *v
 
}
 

	
 
/**
 
 * Delete all automatic orders which were not reached.
 
 * Delete all implicit orders which were not reached.
 
 */
 
void Vehicle::DeleteUnreachedAutoOrders()
 
void Vehicle::DeleteUnreachedImplicitOrders()
 
{
 
	if (this->IsGroundVehicle()) {
 
		uint16 &gv_flags = this->GetGroundVehicleFlags();
 
		if (HasBit(gv_flags, GVF_SUPPRESS_AUTOMATIC_ORDERS)) {
 
		if (HasBit(gv_flags, GVF_SUPPRESS_IMPLICIT_ORDERS)) {
 
			/* Do not delete orders, only skip them */
 
			ClrBit(gv_flags, GVF_SUPPRESS_AUTOMATIC_ORDERS);
 
			this->cur_auto_order_index = this->cur_real_order_index;
 
			ClrBit(gv_flags, GVF_SUPPRESS_IMPLICIT_ORDERS);
 
			this->cur_implicit_order_index = this->cur_real_order_index;
 
			InvalidateVehicleOrder(this, 0);
 
			return;
 
		}
 
	}
 

	
 
	const Order *order = this->GetOrder(this->cur_auto_order_index);
 
	const Order *order = this->GetOrder(this->cur_implicit_order_index);
 
	while (order != NULL) {
 
		if (this->cur_auto_order_index == this->cur_real_order_index) break;
 
		if (this->cur_implicit_order_index == this->cur_real_order_index) break;
 

	
 
		if (order->IsType(OT_AUTOMATIC)) {
 
		if (order->IsType(OT_IMPLICIT)) {
 
			/* Delete order effectively deletes order, so get the next before deleting it. */
 
			order = order->next;
 
			DeleteOrder(this, this->cur_auto_order_index);
 
			DeleteOrder(this, this->cur_implicit_order_index);
 
		} else {
 
			/* Skip non-automatic orders, e.g. service-orders */
 
			/* Skip non-implicit orders, e.g. service-orders */
 
			order = order->next;
 
			this->cur_auto_order_index++;
 
			this->cur_implicit_order_index++;
 
		}
 

	
 
		/* Wrap around */
 
		if (order == NULL) {
 
			order = this->GetOrder(0);
 
			this->cur_auto_order_index = 0;
 
			this->cur_implicit_order_index = 0;
 
		}
 
	}
 
}
 
@@ -1840,7 +1840,7 @@ void Vehicle::BeginLoading()
 

	
 
	if (this->current_order.IsType(OT_GOTO_STATION) &&
 
			this->current_order.GetDestination() == this->last_station_visited) {
 
		this->DeleteUnreachedAutoOrders();
 
		this->DeleteUnreachedImplicitOrders();
 

	
 
		/* Now both order indices point to the destination station, and we can start loading */
 
		this->current_order.MakeLoading(true);
 
@@ -1855,74 +1855,74 @@ void Vehicle::BeginLoading()
 

	
 
	} else {
 
		assert(this->IsGroundVehicle());
 
		bool suppress_automatic_orders = HasBit(this->GetGroundVehicleFlags(), GVF_SUPPRESS_AUTOMATIC_ORDERS);
 
		bool suppress_implicit_orders = HasBit(this->GetGroundVehicleFlags(), GVF_SUPPRESS_IMPLICIT_ORDERS);
 

	
 
		/* We weren't scheduled to stop here. Insert an automatic order
 
		/* We weren't scheduled to stop here. Insert an implicit order
 
		 * to show that we are stopping here, but only do that if the order
 
		 * list isn't empty. */
 
		Order *in_list = this->GetOrder(this->cur_auto_order_index);
 
		Order *in_list = this->GetOrder(this->cur_implicit_order_index);
 
		if (in_list != NULL &&
 
				(!in_list->IsType(OT_AUTOMATIC) ||
 
				(!in_list->IsType(OT_IMPLICIT) ||
 
				in_list->GetDestination() != this->last_station_visited)) {
 
			/* Do not create consecutive duplicates of automatic orders */
 
			Order *prev_order = this->cur_auto_order_index > 0 ? this->GetOrder(this->cur_auto_order_index - 1) : NULL;
 
			/* Do not create consecutive duplicates of implicit orders */
 
			Order *prev_order = this->cur_implicit_order_index > 0 ? this->GetOrder(this->cur_implicit_order_index - 1) : NULL;
 
			if (prev_order == NULL ||
 
					(!prev_order->IsType(OT_AUTOMATIC) && !prev_order->IsType(OT_GOTO_STATION)) ||
 
					(!prev_order->IsType(OT_IMPLICIT) && !prev_order->IsType(OT_GOTO_STATION)) ||
 
					prev_order->GetDestination() != this->last_station_visited) {
 

	
 
				/* Prefer deleting automatic orders instead of inserting new ones,
 
				/* Prefer deleting implicit orders instead of inserting new ones,
 
				 * so test whether the right order follows later */
 
				int target_index = this->cur_auto_order_index;
 
				int target_index = this->cur_implicit_order_index;
 
				bool found = false;
 
				while (target_index != this->cur_real_order_index) {
 
					const Order *order = this->GetOrder(target_index);
 
					if (order->IsType(OT_AUTOMATIC) && order->GetDestination() == this->last_station_visited) {
 
					if (order->IsType(OT_IMPLICIT) && order->GetDestination() == this->last_station_visited) {
 
						found = true;
 
						break;
 
					}
 
					target_index++;
 
					if (target_index >= this->orders.list->GetNumOrders()) target_index = 0;
 
					assert(target_index != this->cur_auto_order_index); // infinite loop?
 
					assert(target_index != this->cur_implicit_order_index); // infinite loop?
 
				}
 

	
 
				if (found) {
 
					if (suppress_automatic_orders) {
 
					if (suppress_implicit_orders) {
 
						/* Skip to the found order */
 
						this->cur_auto_order_index = target_index;
 
						this->cur_implicit_order_index = target_index;
 
						InvalidateVehicleOrder(this, 0);
 
					} else {
 
						/* Delete all automatic orders up to the station we just reached */
 
						const Order *order = this->GetOrder(this->cur_auto_order_index);
 
						while (!order->IsType(OT_AUTOMATIC) || order->GetDestination() != this->last_station_visited) {
 
							if (order->IsType(OT_AUTOMATIC)) {
 
						/* Delete all implicit orders up to the station we just reached */
 
						const Order *order = this->GetOrder(this->cur_implicit_order_index);
 
						while (!order->IsType(OT_IMPLICIT) || order->GetDestination() != this->last_station_visited) {
 
							if (order->IsType(OT_IMPLICIT)) {
 
								/* Delete order effectively deletes order, so get the next before deleting it. */
 
								order = order->next;
 
								DeleteOrder(this, this->cur_auto_order_index);
 
								DeleteOrder(this, this->cur_implicit_order_index);
 
							} else {
 
								/* Skip non-automatic orders, e.g. service-orders */
 
								/* Skip non-implicit orders, e.g. service-orders */
 
								order = order->next;
 
								this->cur_auto_order_index++;
 
								this->cur_implicit_order_index++;
 
							}
 

	
 
							/* Wrap around */
 
							if (order == NULL) {
 
								order = this->GetOrder(0);
 
								this->cur_auto_order_index = 0;
 
								this->cur_implicit_order_index = 0;
 
							}
 
							assert(order != NULL);
 
						}
 
					}
 
				} else if (!suppress_automatic_orders && this->orders.list->GetNumOrders() < MAX_VEH_ORDER_ID && Order::CanAllocateItem()) {
 
					/* Insert new automatic order */
 
					Order *auto_order = new Order();
 
					auto_order->MakeAutomatic(this->last_station_visited);
 
					InsertOrder(this, auto_order, this->cur_auto_order_index);
 
					if (this->cur_auto_order_index > 0) --this->cur_auto_order_index;
 
				} else if (!suppress_implicit_orders && this->orders.list->GetNumOrders() < MAX_VEH_ORDER_ID && Order::CanAllocateItem()) {
 
					/* Insert new implicit order */
 
					Order *implicit_order = new Order();
 
					implicit_order->MakeImplicit(this->last_station_visited);
 
					InsertOrder(this, implicit_order, this->cur_implicit_order_index);
 
					if (this->cur_implicit_order_index > 0) --this->cur_implicit_order_index;
 

	
 
					/* InsertOrder disabled creation of automatic orders for all vehicles with the same automatic order.
 
					/* InsertOrder disabled creation of implicit orders for all vehicles with the same implicit order.
 
					 * Reenable it for this vehicle */
 
					uint16 &gv_flags = this->GetGroundVehicleFlags();
 
					ClrBit(gv_flags, GVF_SUPPRESS_AUTOMATIC_ORDERS);
 
					ClrBit(gv_flags, GVF_SUPPRESS_IMPLICIT_ORDERS);
 
				}
 
			}
 
		}
 
@@ -1990,9 +1990,9 @@ void Vehicle::HandleLoading(bool mode)
 
			this->LeaveStation();
 

	
 
			/* Only advance to next order if we just loaded at the current one */
 
			const Order *order = this->GetOrder(this->cur_auto_order_index);
 
			const Order *order = this->GetOrder(this->cur_implicit_order_index);
 
			if (order == NULL ||
 
					(!order->IsType(OT_AUTOMATIC) && !order->IsType(OT_GOTO_STATION)) ||
 
					(!order->IsType(OT_IMPLICIT) && !order->IsType(OT_GOTO_STATION)) ||
 
					order->GetDestination() != this->last_station_visited) {
 
				return;
 
			}
 
@@ -2004,7 +2004,7 @@ void Vehicle::HandleLoading(bool mode)
 
		default: return;
 
	}
 

	
 
	this->IncrementAutoOrderIndex();
 
	this->IncrementImplicitOrderIndex();
 
}
 

	
 
/**
 
@@ -2043,7 +2043,7 @@ CommandCost Vehicle::SendToDepot(DoComma
 

	
 
			if (this->IsGroundVehicle()) {
 
				uint16 &gv_flags = this->GetGroundVehicleFlags();
 
				SetBit(gv_flags, GVF_SUPPRESS_AUTOMATIC_ORDERS);
 
				SetBit(gv_flags, GVF_SUPPRESS_IMPLICIT_ORDERS);
 
			}
 

	
 
			this->current_order.MakeDummy();
 
@@ -2063,7 +2063,7 @@ CommandCost Vehicle::SendToDepot(DoComma
 

	
 
		if (this->IsGroundVehicle()) {
 
			uint16 &gv_flags = this->GetGroundVehicleFlags();
 
			SetBit(gv_flags, GVF_SUPPRESS_AUTOMATIC_ORDERS);
 
			SetBit(gv_flags, GVF_SUPPRESS_IMPLICIT_ORDERS);
 
		}
 

	
 
		this->dest_tile = location;
src/vehicle_base.h
Show inline comments
 
@@ -220,8 +220,8 @@ public:
 

	
 
	byte vehstatus;                     ///< Status
 
	Order current_order;                ///< The current order (+ status, like: loading)
 
	VehicleOrderID cur_real_order_index;///< The index to the current real (non-automatic) order
 
	VehicleOrderID cur_auto_order_index;///< The index to the current automatic order
 
	VehicleOrderID cur_real_order_index;///< The index to the current real (non-implicit) order
 
	VehicleOrderID cur_implicit_order_index;///< The index to the current implicit order
 

	
 
	union {
 
		OrderList *list;            ///< Pointer to the order list for this vehicle
 
@@ -252,7 +252,7 @@ public:
 
	uint16 &GetGroundVehicleFlags();
 
	const uint16 &GetGroundVehicleFlags() const;
 

	
 
	void DeleteUnreachedAutoOrders();
 
	void DeleteUnreachedImplicitOrders();
 

	
 
	void HandleLoading(bool mode = false);
 

	
 
@@ -552,7 +552,7 @@ public:
 
		this->unitnumber = src->unitnumber;
 

	
 
		this->cur_real_order_index = src->cur_real_order_index;
 
		this->cur_auto_order_index = src->cur_auto_order_index;
 
		this->cur_implicit_order_index = src->cur_implicit_order_index;
 
		this->current_order = src->current_order;
 
		this->dest_tile  = src->dest_tile;
 

	
 
@@ -605,7 +605,7 @@ public:
 
private:
 
	/**
 
	 * Advance cur_real_order_index to the next real order.
 
	 * cur_auto_order_index is not touched.
 
	 * cur_implicit_order_index is not touched.
 
	 */
 
	void SkipToNextRealOrderIndex()
 
	{
 
@@ -614,7 +614,7 @@ private:
 
			do {
 
				this->cur_real_order_index++;
 
				if (this->cur_real_order_index >= this->GetNumOrders()) this->cur_real_order_index = 0;
 
			} while (this->GetOrder(this->cur_real_order_index)->IsType(OT_AUTOMATIC));
 
			} while (this->GetOrder(this->cur_real_order_index)->IsType(OT_IMPLICIT));
 
		} else {
 
			this->cur_real_order_index = 0;
 
		}
 
@@ -622,39 +622,39 @@ private:
 

	
 
public:
 
	/**
 
	 * Increments cur_auto_order_index, keeps care of the wrap-around and invalidates the GUI.
 
	 * Increments cur_implicit_order_index, keeps care of the wrap-around and invalidates the GUI.
 
	 * cur_real_order_index is incremented as well, if needed.
 
	 * Note: current_order is not invalidated.
 
	 */
 
	void IncrementAutoOrderIndex()
 
	void IncrementImplicitOrderIndex()
 
	{
 
		if (this->cur_auto_order_index == this->cur_real_order_index) {
 
		if (this->cur_implicit_order_index == this->cur_real_order_index) {
 
			/* Increment real order index as well */
 
			this->SkipToNextRealOrderIndex();
 
		}
 

	
 
		assert(this->cur_real_order_index == 0 || this->cur_real_order_index < this->GetNumOrders());
 

	
 
		/* Advance to next automatic order */
 
		/* Advance to next implicit order */
 
		do {
 
			this->cur_auto_order_index++;
 
			if (this->cur_auto_order_index >= this->GetNumOrders()) this->cur_auto_order_index = 0;
 
		} while (this->cur_auto_order_index != this->cur_real_order_index && !this->GetOrder(this->cur_auto_order_index)->IsType(OT_AUTOMATIC));
 
			this->cur_implicit_order_index++;
 
			if (this->cur_implicit_order_index >= this->GetNumOrders()) this->cur_implicit_order_index = 0;
 
		} while (this->cur_implicit_order_index != this->cur_real_order_index && !this->GetOrder(this->cur_implicit_order_index)->IsType(OT_IMPLICIT));
 

	
 
		InvalidateVehicleOrder(this, 0);
 
	}
 

	
 
	/**
 
	 * Advanced cur_real_order_index to the next real order, keeps care of the wrap-around and invalidates the GUI.
 
	 * cur_auto_order_index is incremented as well, if it was equal to cur_real_order_index, i.e. cur_real_order_index is skipped
 
	 * but not any automatic orders.
 
	 * cur_implicit_order_index is incremented as well, if it was equal to cur_real_order_index, i.e. cur_real_order_index is skipped
 
	 * but not any implicit orders.
 
	 * Note: current_order is not invalidated.
 
	 */
 
	void IncrementRealOrderIndex()
 
	{
 
		if (this->cur_auto_order_index == this->cur_real_order_index) {
 
			/* Increment both real and auto order */
 
			this->IncrementAutoOrderIndex();
 
		if (this->cur_implicit_order_index == this->cur_real_order_index) {
 
			/* Increment both real and implicit order */
 
			this->IncrementImplicitOrderIndex();
 
		} else {
 
			/* Increment real order only */
 
			this->SkipToNextRealOrderIndex();
 
@@ -663,7 +663,7 @@ public:
 
	}
 

	
 
	/**
 
	 * Skip automatic orders until cur_real_order_index is a non-automatic order.
 
	 * Skip implicit orders until cur_real_order_index is a non-implicit order.
 
	 */
 
	void UpdateRealOrderIndex()
 
	{
 
@@ -672,7 +672,7 @@ public:
 

	
 
		if (this->GetNumManualOrders() > 0) {
 
			/* Advance to next real order */
 
			while (this->GetOrder(this->cur_real_order_index)->IsType(OT_AUTOMATIC)) {
 
			while (this->GetOrder(this->cur_real_order_index)->IsType(OT_IMPLICIT)) {
 
				this->cur_real_order_index++;
 
				if (this->cur_real_order_index >= this->GetNumOrders()) this->cur_real_order_index = 0;
 
			}
src/vehiclelist.cpp
Show inline comments
 
@@ -118,7 +118,7 @@ bool GenerateVehicleSortList(VehicleList
 
					const Order *order;
 

	
 
					FOR_VEHICLE_ORDERS(v, order) {
 
						if ((order->IsType(OT_GOTO_STATION) || order->IsType(OT_GOTO_WAYPOINT) || order->IsType(OT_AUTOMATIC))
 
						if ((order->IsType(OT_GOTO_STATION) || order->IsType(OT_GOTO_WAYPOINT) || order->IsType(OT_IMPLICIT))
 
								&& order->GetDestination() == vli.index) {
 
							*list->Append() = v;
 
							break;
0 comments (0 inline, 0 general)