--- src/station_cmd.cpp +++ src/station_cmd.cpp @@ -2052,8 +2052,10 @@ TileArea roadstop_area(tile, width, height); - int quantity = 0; CommandCost cost(EXPENSES_CONSTRUCTION); + CommandCost last_error(STR_ERROR_THERE_IS_NO_STATION); + bool had_success = false; + TILE_AREA_LOOP(cur_tile, roadstop_area) { /* Make sure the specified tile is a road stop of the correct type */ if (!IsTileType(cur_tile, MP_STATION) || !IsRoadStop(cur_tile) || (uint32)GetRoadStopType(cur_tile) != GB(p2, 0, 1)) continue; @@ -2073,10 +2075,13 @@ } CommandCost ret = RemoveRoadStop(cur_tile, flags); - if (ret.Failed()) return ret; + if (ret.Failed()) { + last_error = ret; + continue; + } cost.AddCost(ret); - - quantity++; + had_success = true; + /* Restore roads. */ if ((flags & DC_EXEC) && rts != ROADTYPES_NONE) { MakeRoadNormal(cur_tile, road_bits, rts, ClosestTownFromTile(cur_tile, UINT_MAX)->index, @@ -2094,9 +2099,7 @@ } } - if (quantity == 0) return_cmd_error(STR_ERROR_THERE_IS_NO_STATION); - - return cost; + return had_success ? cost : last_error; } /**