summaryrefslogtreecommitdiff
path: root/station_cmd.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-08-12 21:11:23 +0000
committerdarkvater <darkvater@openttd.org>2004-08-12 21:11:23 +0000
commit52f8e963c1e1b577ece5001ef24653442da8b47d (patch)
tree1c63841b4fcafe65a4f29ec32b917e27170503fa /station_cmd.c
parentcbec93d9b6bf7e19bad65eda928b4e88620e481d (diff)
downloadopenttd-52f8e963c1e1b577ece5001ef24653442da8b47d.tar.xz
(svn r29) -Fix You cannot take ownership of an oilrig by building right next to it
-Fix when adding parts to a statin max size is not 15x15 anymore, but _patches.station_spread
Diffstat (limited to 'station_cmd.c')
-rw-r--r--station_cmd.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/station_cmd.c b/station_cmd.c
index 4c9c9c4d6..b54f81b39 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -43,6 +43,13 @@ static Station *GetStationAround(uint tile, int w, int h, int closest_station)
if (IS_TILETYPE(tile_cur, MP_STATION)) {
int t;
t = _map2[tile_cur];
+ {
+ Station *st = DEREF_STATION(t);
+ // you cannot take control of an oilrig!!
+ if (st->airport_type == AT_OILRIG && st->facilities == (FACIL_AIRPORT|FACIL_DOCK))
+ continue;
+ }
+
if (closest_station == -1) {
closest_station = t;
} else if (closest_station != t) {
@@ -538,16 +545,8 @@ 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.
@@ -657,7 +656,7 @@ static bool CanExpandRailroadStation(Station *st, uint *fin, int direction)
return false;
}
// make sure the final size is not too big.
- if (curw > 15 || curh > 15) return false;
+ if (curw > _patches.station_spread || curh > _patches.station_spread) return false;
// now tile contains the new value for st->train_tile
// curw, curh contain the new value for width and height