Changeset - r2747:bfaba6b493b0
[Not reviewed]
master
0 1 0
peter1138 - 18 years ago 2005-12-13 12:31:48
peter1138@openttd.org
(svn r3292) - Autoreplace: Disallow replacing to an engine type that already has a replacement set up; this stops loops being set up.
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
vehicle_gui.c
Show inline comments
 
@@ -831,10 +831,12 @@ static void ReplaceVehicleWndProc(Window
 
				// Disable the "Start Replacing" button if:
 
				//    Either list is empty
 
				// or Both lists have the same vehicle selected
 
				// or The selected replacement engine has a replacement (to prevent loops)
 
				// or The right list (new replacement) has the existing replacement vehicle selected
 
				if (selected_id[0] == INVALID_ENGINE ||
 
						selected_id[1] == INVALID_ENGINE ||
 
						selected_id[0] == selected_id[1] ||
 
						EngineReplacement(p, selected_id[1]) != INVALID_ENGINE ||
 
						EngineReplacement(p, selected_id[0]) == selected_id[1]) {
 
					SETBIT(w->disabled_state, 4);
 
				} else {
0 comments (0 inline, 0 general)