summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-08-12 20:24:28 +0000
committerdarkvater <darkvater@openttd.org>2004-08-12 20:24:28 +0000
commitcbec93d9b6bf7e19bad65eda928b4e88620e481d (patch)
treedef34906900fbb256e8af934c8f8248252288a3a
parent210ada1b514a173de5a2426f99cd25c95b23efaf (diff)
downloadopenttd-cbec93d9b6bf7e19bad65eda928b4e88620e481d.tar.xz
(svn r28) -Fix removing station merged with oilrig, will reset oilrigs ownership
-rw-r--r--station_cmd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/station_cmd.c b/station_cmd.c
index 3a9256420..4c9c9c4d6 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -538,8 +538,16 @@ static void UpdateStationAcceptance(Station *st, bool show_msg)
static void DeleteStationIfEmpty(Station *st) {
if (st->facilities == 0) {
st->delete_ctr = 0;
+ }
+
+ // if a station next to an oilrig is removed, fix ownership
+ if (st->airport_type == AT_OILRIG && st->facilities == (FACIL_AIRPORT|FACIL_DOCK) ) {
+ _station_sort_dirty = true;
InvalidateWindow(WC_STATION_LIST, st->owner);
+ st->owner = 0x10;
}
+
+ InvalidateWindow(WC_STATION_LIST, st->owner);
}
// Tries to clear the given area. Returns the cost in case of success.
@@ -2319,7 +2327,7 @@ void BuildOilRig(uint tile)
_map3_hi[tile] = 0;
_map2[tile] = st->index;
- st->owner = 0x10;
+ st->owner = OWNER_NONE;
st->airport_flags = 0;
st->airport_type = AT_OILRIG;
st->xy = tile;