From 246c126d250171bd69f66080dbc25fafef6a46d2 Mon Sep 17 00:00:00 2001 From: tron Date: Thu, 29 Dec 2005 12:42:59 +0000 Subject: (svn r3353) Simplify the automatic length adjustment algorithm for replacing trains: Use the length of the train before the replacement as reference length --- vehicle_gui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vehicle_gui.c') diff --git a/vehicle_gui.c b/vehicle_gui.c index fbfd7d698..c8e184c13 100644 --- a/vehicle_gui.c +++ b/vehicle_gui.c @@ -747,10 +747,10 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e) STR_019E_SHIP, STR_019D_AIRCRAFT }; - const Player *p = GetPlayer(_local_player); switch (e->event) { case WE_PAINT: { + const Player *p = GetPlayer(_local_player); int pos = w->vscroll.pos; EngineID selected_id[2] = { INVALID_ENGINE, INVALID_ENGINE }; int x = 1; @@ -934,7 +934,7 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e) break; } case 17: { /* toggle renew_keep_length */ - DoCommandP(0, 5, p->renew_keep_length ? 0 : 1, NULL, CMD_REPLACE_VEHICLE); + DoCommandP(0, 5, GetPlayer(_local_player)->renew_keep_length ? 0 : 1, NULL, CMD_REPLACE_VEHICLE); } break; case 4: { /* Start replacing */ EngineID veh_from = WP(w, replaceveh_d).sel_engine[0]; -- cgit v1.2.3-54-g00ecf