# HG changeset patch # User peter1138 # Date 1161628126 0 # Node ID 5253a78cee3fe3e2aa2298664413557e47a57e05 # Parent ff53f78c5a87f5bf1d363371ed33e0b168aa43dc (svn r6909) - Codechange: Base the decision to draw rail engine or wagon purchase information on the rail vehicle type, not an arbitrary value. diff -r ff53f78c5a87 -r 5253a78cee3f vehicle_gui.c --- a/vehicle_gui.c Mon Oct 23 18:13:24 2006 +0000 +++ b/vehicle_gui.c Mon Oct 23 18:28:46 2006 +0000 @@ -990,11 +990,11 @@ } } -static void DrawVehiclePurchaseInfo(const int x, const int y, const EngineID engine_number, const bool draw_locomotive) +static void DrawVehiclePurchaseInfo(const int x, const int y, const EngineID engine_number) { switch (GetEngine(engine_number)->type) { case VEH_Train: - if (draw_locomotive) { + if ((RailVehInfo(engine_number)->flags & RVI_WAGON) == 0) { DrawTrainEnginePurchaseInfo(x, y, engine_number); } else { DrawTrainWagonPurchaseInfo(x, y, engine_number); @@ -1090,7 +1090,7 @@ /* now we draw the info about the vehicles we selected */ for (i = 0 ; i < 2 ; i++) { if (selected_id[i] != INVALID_ENGINE) { - DrawVehiclePurchaseInfo((i == 1) ? 230 : 2 , 15 + (w->resize.step_height * w->vscroll.cap), selected_id[i], WP(w, replaceveh_d).wagon_btnstate); + DrawVehiclePurchaseInfo((i == 1) ? 230 : 2 , 15 + (w->resize.step_height * w->vscroll.cap), selected_id[i]); } } } break; // end of paint