summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-02 08:47:56 +0000
committerrubidium <rubidium@openttd.org>2007-08-02 08:47:56 +0000
commit9378e5fd3845935b0ec00be40a2de8a0748ab7d0 (patch)
tree3e62b54a68ddd881fdf9a38f773673dd2d809a09 /src/station_cmd.cpp
parentaa78685c99dc1cd2fe28a05ba55eb719e12f4029 (diff)
downloadopenttd-9378e5fd3845935b0ec00be40a2de8a0748ab7d0.tar.xz
(svn r10746) -Codechange: add a generic superclass for almost all pool items so we do not have to duplicate code for each of the pool item classes and use it for the station and roadstop classes.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index b5ca877f1..045da52a4 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -927,7 +927,7 @@ CommandCost CmdBuildRailroadStation(TileIndex tile_org, uint32 flags, uint32 p1,
} else {
/* allocate and initialize new station */
st = new Station(tile_org);
- if (st == NULL) return CMD_ERROR;
+ if (st == NULL) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING);
/* ensure that in case of error (or no DC_EXEC) the station gets deleted upon return */
st_auto_delete = st;
@@ -1358,7 +1358,7 @@ CommandCost CmdBuildRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
} else {
/* allocate and initialize new station */
st = new Station(tile);
- if (st == NULL) return CMD_ERROR;
+ if (st == NULL) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING);
/* ensure that in case of error (or no DC_EXEC) the new station gets deleted upon return */
st_auto_delete = st;
@@ -1652,7 +1652,7 @@ CommandCost CmdBuildAirport(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
/* allocate and initialize new station */
st = new Station(tile);
- if (st == NULL) return CMD_ERROR;
+ if (st == NULL) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING);
/* ensure that in case of error (or no DC_EXEC) the station gets deleted upon return */
st_auto_delete = st;
@@ -1774,7 +1774,7 @@ CommandCost CmdBuildBuoy(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
/* allocate and initialize new station */
Station *st = new Station(tile);
- if (st == NULL) return CMD_ERROR;
+ if (st == NULL) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING);
/* ensure that in case of error (or no DC_EXEC) the station gets deleted upon return */
AutoPtrT<Station> st_auto_delete(st);
@@ -1939,7 +1939,7 @@ CommandCost CmdBuildDock(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
} else {
/* allocate and initialize new station */
st = new Station(tile);
- if (st == NULL) return CMD_ERROR;
+ if (st == NULL) return_cmd_error(STR_3008_TOO_MANY_STATIONS_LOADING);
/* ensure that in case of error (or no DC_EXEC) the station gets deleted upon return */
st_auto_delete = st;