summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2007-02-18 08:37:39 +0000
committertron <tron@openttd.org>2007-02-18 08:37:39 +0000
commit25a3485e71bf2cb93efee2731d37db8f73974390 (patch)
treed24009d17657b293242d4e0a913d94b9e8137f94
parent8bfc6df882955042108d7ea3b184d44c3374d8e5 (diff)
downloadopenttd-25a3485e71bf2cb93efee2731d37db8f73974390.tar.xz
(svn r8794) -Fix
Remove the possiblity to take over stations with OWNER_NONE by building a station next to it -Fix: It was possible to take over buoys by building a station next to them Also remove the now unnecessary special case which prevented taking over oilrigs NOTE: 0.5 candidate
-rw-r--r--src/station_cmd.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index c49108882..a13edd7a5 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -129,12 +129,6 @@ static Station* GetStationAround(TileIndex tile, int w, int h, StationID closest
BEGIN_TILE_LOOP(tile_cur, w + 2, h + 2, tile - TileDiffXY(1, 1))
if (IsTileType(tile_cur, MP_STATION)) {
StationID t = GetStationIndex(tile_cur);
- {
- Station *st = GetStation(t);
- // you cannot take control of an oilrig!!
- if (st->airport_type == AT_OILRIG && st->facilities == (FACIL_AIRPORT|FACIL_DOCK))
- continue;
- }
if (closest_station == INVALID_STATION) {
closest_station = t;
@@ -910,7 +904,7 @@ int32 CmdBuildRailroadStation(TileIndex tile_org, uint32 flags, uint32 p1, uint3
if (st != NULL) {
// Reuse an existing station.
- if (st->owner != OWNER_NONE && st->owner != _current_player)
+ if (st->owner != _current_player)
return_cmd_error(STR_3009_TOO_CLOSE_TO_ANOTHER_STATION);
if (st->train_tile != 0) {
@@ -1293,7 +1287,7 @@ int32 CmdBuildRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
AutoPtrT<Station> st_auto_delete;
if (st != NULL) {
- if (st->owner != OWNER_NONE && st->owner != _current_player) {
+ if (st->owner != _current_player) {
return_cmd_error(STR_3009_TOO_CLOSE_TO_ANOTHER_STATION);
}
@@ -1585,7 +1579,7 @@ int32 CmdBuildAirport(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
AutoPtrT<Station> st_auto_delete;
if (st != NULL) {
- if (st->owner != OWNER_NONE && st->owner != _current_player)
+ if (st->owner != _current_player)
return_cmd_error(STR_3009_TOO_CLOSE_TO_ANOTHER_STATION);
if (!st->rect.BeforeAddRect(tile, w, h, StationRect::ADD_TEST)) return CMD_ERROR;
@@ -1872,7 +1866,7 @@ int32 CmdBuildDock(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
AutoPtrT<Station> st_auto_delete;
if (st != NULL) {
- if (st->owner != OWNER_NONE && st->owner != _current_player)
+ if (st->owner != _current_player)
return_cmd_error(STR_3009_TOO_CLOSE_TO_ANOTHER_STATION);
if (!st->rect.BeforeAddRect(tile, _dock_w_chk[direction], _dock_h_chk[direction], StationRect::ADD_TEST)) return CMD_ERROR;