ai.c
changeset 76 30511cbc5188
parent 21 67cde01e8359
child 159 139cf78bfb28
--- a/ai.c	Tue Aug 17 15:37:12 2004 +0000
+++ b/ai.c	Tue Aug 17 16:20:04 2004 +0000
@@ -301,6 +301,8 @@
 			veh = _new_train_id;
 			AiRestoreVehicleOrders(&_vehicles[veh], orderbak);
 			DoCommandByTile(0, veh, 0, DC_EXEC, CMD_START_STOP_TRAIN);
+			// Force the service interval to 180 days.. else things can go very wrong :p
+			DoCommandByTile(0, veh, 180, DC_EXEC, CMD_CHANGE_TRAIN_SERVICE_INT);
 		}
 	}
 }
@@ -327,6 +329,8 @@
 			veh = _new_roadveh_id;
 			AiRestoreVehicleOrders(&_vehicles[veh], orderbak);
 			DoCommandByTile(0, veh, 0, DC_EXEC, CMD_START_STOP_ROADVEH);
+			// Force the service interval to 180 days.. else things can go very wrong :p
+			DoCommandByTile(0, veh, 180, DC_EXEC, CMD_CHANGE_ROADVEH_SERVICE_INT);
 		}
 	}
 }
@@ -353,6 +357,8 @@
 			veh = _new_aircraft_id;
 			AiRestoreVehicleOrders(&_vehicles[veh], orderbak);
 			DoCommandByTile(0, veh, 0, DC_EXEC, CMD_START_STOP_AIRCRAFT);
+			// Force the service interval to 180 days.. else things can go very wrong :p
+			DoCommandByTile(0, veh, 180, DC_EXEC, CMD_CHANGE_AIRCRAFT_SERVICE_INT);
 		}
 	}
 }
@@ -1492,6 +1498,10 @@
 	for(;;) {
 		r = (uint16)Random();
 		
+		if (_patches.ai_disable_veh_train && _patches.ai_disable_veh_roadveh &&
+			_patches.ai_disable_veh_aircraft && _patches.ai_disable_veh_ship)
+			return;
+		
 		if (r < 0x7626) {
 			if (_patches.ai_disable_veh_train) continue;
 			AiWantTrainRoute(p);
@@ -2422,6 +2432,8 @@
 	}
 
 	DoCommandByTile(0, loco_id, 0, DC_EXEC, CMD_START_STOP_TRAIN);
+	// Force the service interval to 180 days.. else things can go very wrong :p
+	DoCommandByTile(0, loco_id, 180, DC_EXEC, CMD_CHANGE_TRAIN_SERVICE_INT);
 
 	if (p->ai.num_want_fullload != 0)
 		p->ai.num_want_fullload--;
@@ -3167,6 +3179,8 @@
 	}
 
 	DoCommandByTile(0, loco_id, 0, DC_EXEC, CMD_START_STOP_ROADVEH);
+	// Force the service interval to 180 days.. else things can go very wrong :p
+	DoCommandByTile(0, loco_id, 180, DC_EXEC, CMD_CHANGE_ROADVEH_SERVICE_INT);
 
 	if (p->ai.num_want_fullload != 0)
 		p->ai.num_want_fullload--;
@@ -3473,6 +3487,8 @@
 	}
 
 	DoCommandByTile(0, loco_id, 0, DC_EXEC, CMD_START_STOP_AIRCRAFT);
+	// Force the service interval to 180 days.. else things can go very wrong :p
+	DoCommandByTile(0, loco_id, 180, DC_EXEC, CMD_CHANGE_AIRCRAFT_SERVICE_INT);
 
 	if (p->ai.num_want_fullload != 0)
 		p->ai.num_want_fullload--;