mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-05 13:57:01 +00:00
(svn r14316) -Fix: do not allow building road over level crossings and drive-through road stops in the wrong direction even when the roadtype is present
This commit is contained in:
parent
c4d49dfc21
commit
54d1b49981
@ -523,10 +523,11 @@ CommandCost CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
|||||||
} break;
|
} break;
|
||||||
|
|
||||||
case ROAD_TILE_CROSSING:
|
case ROAD_TILE_CROSSING:
|
||||||
if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
|
|
||||||
other_bits = GetCrossingRoadBits(tile);
|
other_bits = GetCrossingRoadBits(tile);
|
||||||
if (pieces & ComplementRoadBits(other_bits)) goto do_clear;
|
if (pieces & ComplementRoadBits(other_bits)) goto do_clear;
|
||||||
pieces = other_bits; // we need to pay for both roadbits
|
pieces = other_bits; // we need to pay for both roadbits
|
||||||
|
|
||||||
|
if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -578,11 +579,12 @@ CommandCost CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
|||||||
|
|
||||||
case MP_STATION: {
|
case MP_STATION: {
|
||||||
if (!IsDriveThroughStopTile(tile)) goto do_clear;
|
if (!IsDriveThroughStopTile(tile)) goto do_clear;
|
||||||
if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
|
|
||||||
|
|
||||||
RoadBits curbits = AxisToRoadBits(DiagDirToAxis(GetRoadStopDir(tile)));
|
RoadBits curbits = AxisToRoadBits(DiagDirToAxis(GetRoadStopDir(tile)));
|
||||||
if (pieces & ~curbits) goto do_clear;
|
if (pieces & ~curbits) goto do_clear;
|
||||||
pieces = curbits; // we need to pay for both roadbits
|
pieces = curbits; // we need to pay for both roadbits
|
||||||
|
|
||||||
|
if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case MP_TUNNELBRIDGE:
|
case MP_TUNNELBRIDGE:
|
||||||
|
Loading…
Reference in New Issue
Block a user