summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-10-12 10:22:13 +0000
committerfrosch <frosch@openttd.org>2008-10-12 10:22:13 +0000
commit9e3b1a8b74fc3bc6603367d0197df7a343df06b6 (patch)
tree4c914a3d4712ed8dad8a3a9b79992284f60d5e02 /src
parentb0ff0245e8c00ffc5dea721b2702332fb6f4dbb6 (diff)
downloadopenttd-9e3b1a8b74fc3bc6603367d0197df7a343df06b6.tar.xz
(svn r14459) -Fix [FS#2343]: Update station-spread when building or removing oilrigs to make them consistent with station-spread-calculation on game-load and to make oilrig-stations behave like any other station type.
Diffstat (limited to 'src')
-rw-r--r--src/station_cmd.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 96e1e1cca..20e9091e5 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -3043,6 +3043,8 @@ void BuildOilRig(TileIndex tile)
st->facilities = FACIL_AIRPORT | FACIL_DOCK;
st->build_date = _date;
+ st->rect.BeforeAddTile(tile, StationRect::ADD_FORCE);
+
for (CargoID j = 0; j < NUM_CARGO; j++) {
st->goods[j].acceptance_pickup = 0;
st->goods[j].days_since_pickup = 255;
@@ -3066,6 +3068,9 @@ void DeleteOilRig(TileIndex tile)
st->airport_tile = 0;
st->facilities &= ~(FACIL_AIRPORT | FACIL_DOCK);
st->airport_flags = 0;
+
+ st->rect.AfterRemoveTile(st, tile);
+
UpdateStationVirtCoordDirty(st);
if (st->facilities == 0) delete st;
}