newgrf_engine.c
changeset 3862 fe7b57944a39
parent 3848 ad94e6144369
child 3866 b13553406a0a
--- a/newgrf_engine.c	Wed May 17 07:16:49 2006 +0000
+++ b/newgrf_engine.c	Wed May 17 08:20:36 2006 +0000
@@ -534,6 +534,7 @@
 			byte cargo_classes = 0;
 			uint common_cargo_best = 0;
 			uint common_cargos[NUM_GLOBAL_CID];
+			byte user_def_data = 0;
 			CargoID cargo;
 			CargoID common_cargo_type = GC_PASSENGERS;
 
@@ -547,6 +548,7 @@
 				cargo = _global_cargo_id[_opt.landscape][u->cargo_type];
 				cargo_classes |= _cargo_classes[cargo];
 				common_cargos[cargo]++;
+				user_def_data |= RailVehInfo(u->engine_type)->user_def_data;
 			}
 
 			/* Pick the most common cargo type */
@@ -557,7 +559,7 @@
 				}
 			}
 
-			return cargo_classes | (common_cargo_type << 8);
+			return cargo_classes | (common_cargo_type << 8) | (user_def_data << 24);
 		}
 
 		case 0x43: /* Player information */