diff options
author | terkhen <terkhen@openttd.org> | 2010-07-10 20:12:32 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2010-07-10 20:12:32 +0000 |
commit | 40e58f78ba2b03e6de6f0d8781d47c1cd3acb6d4 (patch) | |
tree | 76602323eb345b0e113e6d0877a6dd45a2f82d8d /src/road_cmd.cpp | |
parent | 5eb5ddbf313408dd553d80caae44bb0abfe09eaf (diff) | |
download | openttd-40e58f78ba2b03e6de6f0d8781d47c1cd3acb6d4.tar.xz |
(svn r20113) -Add [FS#3895]: Show an specific error message when trying to remove nonexistant roads (Krille).
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r-- | src/road_cmd.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index dfe66a7ab..08536d710 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -180,7 +180,7 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec { RoadTypes rts = GetRoadTypes(tile); /* The tile doesn't have the given road type */ - if (!HasBit(rts, rt)) return CMD_ERROR; + if (!HasBit(rts, rt)) return_cmd_error(rt == ROADTYPE_TRAM ? STR_ERROR_THERE_IS_NO_TRAMWAY : STR_ERROR_THERE_IS_NO_ROAD); switch (GetTileType(tile)) { case MP_ROAD: { @@ -271,7 +271,7 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec /* limit the bits to delete to the existing bits. */ pieces &= present; - if (pieces == ROAD_NONE) return CMD_ERROR; + if (pieces == ROAD_NONE) return_cmd_error(rt == ROADTYPE_TRAM ? STR_ERROR_THERE_IS_NO_TRAMWAY : STR_ERROR_THERE_IS_NO_ROAD); /* Now set present what it will be after the remove */ present ^= pieces; |