mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-21 05:29:11 +00:00
(svn r20113) -Add [FS#3895]: Show an specific error message when trying to remove nonexistant roads (Krille).
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user