summaryrefslogtreecommitdiff
path: root/tunnelbridge_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-05-21 11:34:08 +0000
committertron <tron@openttd.org>2006-05-21 11:34:08 +0000
commit1706164ff7ef6e0da5b05ac2d774fb87b5c349aa (patch)
tree9c3b4dc89f3074d62fa671598258426160248e38 /tunnelbridge_cmd.c
parente693290ed136bed943f34b410a09837bf20a0f21 (diff)
downloadopenttd-1706164ff7ef6e0da5b05ac2d774fb87b5c349aa.tar.xz
(svn r4937) Reduce the use of _error_message a bit
Diffstat (limited to 'tunnelbridge_cmd.c')
-rw-r--r--tunnelbridge_cmd.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c
index 858465aaa..c3c339bdd 100644
--- a/tunnelbridge_cmd.c
+++ b/tunnelbridge_cmd.c
@@ -656,10 +656,7 @@ static int32 DoClearBridge(TileIndex tile, uint32 flags)
endtile - delta,
GetBridgeHeightRamp(tile) + TILE_HEIGHT
);
- if (v != NULL) {
- VehicleInTheWayErrMsg(v);
- return CMD_ERROR;
- }
+ if (v != NULL) return_cmd_error(VehicleInTheWayErrMsg(v));
t = ClosestTownFromTile(tile, (uint)-1); //needed for town rating penalty
// check if you're allowed to remove the bridge owned by a town.
@@ -770,13 +767,11 @@ int32 DoConvertTunnelBridgeRail(TileIndex tile, RailType totype, bool exec)
// Make sure there's no vehicle on the bridge
v = FindVehicleBetween(tile, endtile, z);
if (v != NULL) {
- VehicleInTheWayErrMsg(v);
- return CMD_ERROR;
+ return_cmd_error(VehicleInTheWayErrMsg(v));
}
if (!EnsureNoVehicle(tile) || !EnsureNoVehicle(endtile)) {
- _error_message = STR_8803_TRAIN_IN_THE_WAY;
- return CMD_ERROR;
+ return_cmd_error(STR_8803_TRAIN_IN_THE_WAY);
}
if (GetRailType(tile) == totype) return CMD_ERROR;