summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2005-01-10 12:14:15 +0000
committerdarkvater <darkvater@openttd.org>2005-01-10 12:14:15 +0000
commit94e44d05a1a8f0222bb1f9063f718d08cddeb709 (patch)
tree70f154ec766ee3f85fb54e9852138989550fcacf
parentc07e643b5971a9b94afa4ab8f5e7cae1ad802944 (diff)
downloadopenttd-94e44d05a1a8f0222bb1f9063f718d08cddeb709.tar.xz
(svn r1460) -Fix: [1099225] Bug Fix - Vehicle Lists not updated at Acqusition (thx tamlin and mpetrov) This also fixes some bug but can't find i right now.
-rw-r--r--economy.c1
-rw-r--r--vehicle_gui.c32
2 files changed, 13 insertions, 20 deletions
diff --git a/economy.c b/economy.c
index d7a58a749..0b63c3bf6 100644
--- a/economy.c
+++ b/economy.c
@@ -1519,6 +1519,7 @@ static void DoAcquireCompany(Player *p)
p->is_active = false;
DeletePlayerWindows(pi);
+ RebuildVehicleLists(); //Updates the open windows to add the newly acquired vehicles to the lists
}
extern int GetAmountOwnedBy(Player *p, byte owner);
diff --git a/vehicle_gui.c b/vehicle_gui.c
index 78cd4bd03..4cc1e956c 100644
--- a/vehicle_gui.c
+++ b/vehicle_gui.c
@@ -46,16 +46,12 @@ void RebuildVehicleLists(void)
for (w = _windows; w != _last_window; ++w)
switch (w->window_class) {
- case WC_TRAINS_LIST:
- case WC_ROADVEH_LIST:
- case WC_SHIPS_LIST:
- case WC_AIRCRAFT_LIST:
- WP(w, vehiclelist_d).flags |= VL_REBUILD;
- SetWindowDirty(w);
- break;
-
- default:
- break;
+ case WC_TRAINS_LIST: case WC_ROADVEH_LIST:
+ case WC_SHIPS_LIST: case WC_AIRCRAFT_LIST:
+ WP(w, vehiclelist_d).flags |= VL_REBUILD;
+ SetWindowDirty(w);
+ break;
+ default: break;
}
}
@@ -65,16 +61,12 @@ void ResortVehicleLists(void)
for (w = _windows; w != _last_window; ++w)
switch (w->window_class) {
- case WC_TRAINS_LIST:
- case WC_ROADVEH_LIST:
- case WC_SHIPS_LIST:
- case WC_AIRCRAFT_LIST:
- WP(w, vehiclelist_d).flags |= VL_RESORT;
- SetWindowDirty(w);
- break;
-
- default:
- break;
+ case WC_TRAINS_LIST: case WC_ROADVEH_LIST:
+ case WC_SHIPS_LIST: case WC_AIRCRAFT_LIST:
+ WP(w, vehiclelist_d).flags |= VL_RESORT;
+ SetWindowDirty(w);
+ break;
+ default: break;
}
}