summaryrefslogtreecommitdiff
path: root/src/station.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-03-06 13:23:33 +0000
committeralberth <alberth@openttd.org>2010-03-06 13:23:33 +0000
commit6a3dbaf99a91aa223b2541c172f0ded06c55baf2 (patch)
tree49acf1aa8af1af505e37797a833d9c969d345d2a /src/station.cpp
parentef5764f98a665f554d168c10ac4f5b147d7e0dc3 (diff)
downloadopenttd-6a3dbaf99a91aa223b2541c172f0ded06c55baf2.tar.xz
(svn r19350) -Codechange: StationRect::BeforeAddRect() returns a CommandCost.
Diffstat (limited to 'src/station.cpp')
-rw-r--r--src/station.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/station.cpp b/src/station.cpp
index 9ef44a280..416403048 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -400,16 +400,15 @@ CommandCost StationRect::BeforeAddTile(TileIndex tile, StationRectMode mode)
return CommandCost();
}
-bool StationRect::BeforeAddRect(TileIndex tile, int w, int h, StationRectMode mode)
+CommandCost StationRect::BeforeAddRect(TileIndex tile, int w, int h, StationRectMode mode)
{
if (mode == ADD_FORCE || (w <= _settings_game.station.station_spread && h <= _settings_game.station.station_spread)) {
/* Important when the old rect is completely inside the new rect, resp. the old one was empty. */
CommandCost ret = this->BeforeAddTile(tile, mode);
if (ret.Succeeded()) ret = this->BeforeAddTile(TILE_ADDXY(tile, w - 1, h - 1), mode);
- if (ret.Succeeded()) return true;
- ret.SetGlobalErrorMessage();
+ return ret;
}
- return false;
+ return CommandCost();
}
/**