summaryrefslogtreecommitdiff
path: root/src/station.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-07-05 13:20:05 +0000
committersmatz <smatz@openttd.org>2009-07-05 13:20:05 +0000
commitc861d9b64b2a63fa86ea87ac1e71f8f7341c694b (patch)
treef3aa246db5e1a5db2728facf1e79d65abe0dc75b /src/station.cpp
parent4c6a4e3ab2fb4ebc6a5770c4373b68ff3ffa1d04 (diff)
downloadopenttd-c861d9b64b2a63fa86ea87ac1e71f8f7341c694b.tar.xz
(svn r16745) -Fix [FS#3011]: invalidate JoinStation window after removing item from the pool
Diffstat (limited to 'src/station.cpp')
-rw-r--r--src/station.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/station.cpp b/src/station.cpp
index 4db8c7c0f..32166493f 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -94,8 +94,6 @@ Station::~Station()
/* Remove all news items */
DeleteStationNews(this->index);
- InvalidateWindowData(WC_SELECT_STATION, 0, 0);
-
for (CargoID c = 0; c < NUM_CARGO; c++) {
goods[c].cargo.Truncate(0);
}
@@ -109,6 +107,16 @@ Station::~Station()
/**
+ * Invalidating of the JoinStation window has to be done
+ * after removing item from the pool.
+ * @param index index of deleted item
+ */
+void Station::PostDestructor(size_t index)
+{
+ InvalidateWindowData(WC_SELECT_STATION, 0, 0);
+}
+
+/**
* Get the primary road stop (the first road stop) that the given vehicle can load/unload.
* @param v the vehicle to get the first road stop for
* @return the first roadstop that this vehicle can load at