mirror of https://github.com/OpenTTD/OpenTTD
(svn r16350) -Codechange: make some 'rail track is present' checks more 'secure'
parent
0af27062c4
commit
9af2e38d44
|
@ -116,7 +116,7 @@ static TrackBits GetRailTrackBitsUniversal(TileIndex t, byte *override)
|
||||||
*/
|
*/
|
||||||
static TrackBits MaskWireBits(TileIndex t, TrackBits tracks)
|
static TrackBits MaskWireBits(TileIndex t, TrackBits tracks)
|
||||||
{
|
{
|
||||||
if (!IsPlainRail(t)) return tracks;
|
if (!IsPlainRailTile(t)) return tracks;
|
||||||
|
|
||||||
TrackdirBits neighbour_tdb = TRACKDIR_BIT_NONE;
|
TrackdirBits neighbour_tdb = TRACKDIR_BIT_NONE;
|
||||||
for (DiagDirection d = DIAGDIR_BEGIN; d < DIAGDIR_END; d++) {
|
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 */
|
/* You can only build signals on plain rail tiles, and the selected track must exist */
|
||||||
if (!ValParamTrackOrientation(track) || !IsPlainRailTile(tile) ||
|
if (!ValParamTrackOrientation(track) || !IsPlainRailTile(tile) ||
|
||||||
!EnsureNoTrainOnTrack(tile, track) || !HasTrack(tile, track)) {
|
!HasTrack(tile, track) || !EnsureNoTrainOnTrack(tile, track)) {
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue