From 80125fd934af1e79aa3223f9892d5754d3b4affa Mon Sep 17 00:00:00 2001 From: bjarni Date: Tue, 6 Feb 2007 11:11:12 +0000 Subject: (svn r8610) -Codechange/Feature: rewrote the list handling in the autoreplace window -The user will notice the following changes: All vehicle types behaves in the same way Adding/removing an engine (new design and so on) can no longer result in the window selecting a new engine All valid replacements will be displayed since it looks at refitting options as well (this solves the missing ships with the newships GRF) Since you can't replace an engine into itself, the engine selected in the left list will no longer appear in the right list -The code changes: Instead of looping all engines all the time, each list generates a list like the build windows This ensures consistent list generation since only one function can loop all engines Unified code for all vehicle types It now use the lists to call the drawing code in the build vehicle window Works on selected EngineIDs instead of selected index in the list --- src/players.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/players.cpp') diff --git a/src/players.cpp b/src/players.cpp index 02d30fee8..615db5528 100644 --- a/src/players.cpp +++ b/src/players.cpp @@ -776,7 +776,7 @@ int32 CmdSetAutoReplace(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) cost = RemoveEngineReplacementForPlayer(p, old_engine_type, flags); } - if (IsLocalPlayer()) InvalidateWindow(WC_REPLACE_VEHICLE, GetEngine(old_engine_type)->type); + if (IsLocalPlayer()) InvalidateAutoreplaceWindow(old_engine_type); return cost; } -- cgit v1.2.3-54-g00ecf