mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-01 20:03:26 +00:00
(svn r16350) -Codechange: make some 'rail track is present' checks more 'secure'
This commit is contained in:
parent
0af27062c4
commit
9af2e38d44
@ -116,7 +116,7 @@ static TrackBits GetRailTrackBitsUniversal(TileIndex t, byte *override)
|
||||
*/
|
||||
static TrackBits MaskWireBits(TileIndex t, TrackBits tracks)
|
||||
{
|
||||
if (!IsPlainRail(t)) return tracks;
|
||||
if (!IsPlainRailTile(t)) return tracks;
|
||||
|
||||
TrackdirBits neighbour_tdb = TRACKDIR_BIT_NONE;
|
||||
for (DiagDirection d = DIAGDIR_BEGIN; d < DIAGDIR_END; d++) {
|
||||
|
@ -827,7 +827,7 @@ CommandCost CmdBuildSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1,
|
||||
|
||||
/* You can only build signals on plain rail tiles, and the selected track must exist */
|
||||
if (!ValParamTrackOrientation(track) || !IsPlainRailTile(tile) ||
|
||||
!EnsureNoTrainOnTrack(tile, track) || !HasTrack(tile, track)) {
|
||||
!HasTrack(tile, track) || !EnsureNoTrainOnTrack(tile, track)) {
|
||||
return CMD_ERROR;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user