Changeset - r3412:e18d4747cf1e
[Not reviewed]
master
0 1 0
peter1138 - 18 years ago 2006-04-01 14:53:38
peter1138@openttd.org
(svn r4227) - Fix: Wagon replace nows checks if the cargo types are the same before seeing if it can refit.
1 file changed with 7 insertions and 3 deletions:
0 comments (0 inline, 0 general)
vehicle.c
Show inline comments
 
@@ -1760,9 +1760,13 @@ static void MaybeReplaceVehicle(Vehicle 
 
					continue;
 
			}
 

	
 
			if (w->type == VEH_Train && IsTrainWagon(w) && !CanRefitTo(EngineReplacementForPlayer(p, w->engine_type), w->cargo_type)) {
 
				// we can't replace this wagon since we can't refit the new one to the right cargo type
 
				continue;
 
			if (w->type == VEH_Train && IsTrainWagon(w)) {
 
				EngineID e = EngineReplacementForPlayer(p, w->engine_type);
 

	
 
				if (w->cargo_type != RailVehInfo(e)->cargo_type && !CanRefitTo(e, w->cargo_type)) {
 
					// we can't replace this wagon since the cargo type is incorrent, and we can't refit it
 
					continue;
 
				}
 
			}
 

	
 
			/* Now replace the vehicle */
0 comments (0 inline, 0 general)