mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r25082) -Codechange [FS#5501]: Simplify some code. (adf88)
This commit is contained in:
parent
f800c826a8
commit
aa2ff3d552
@ -1022,15 +1022,8 @@ CommandCost CmdBuildSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1,
|
|||||||
CommandCost ret = CheckTileOwnership(tile);
|
CommandCost ret = CheckTileOwnership(tile);
|
||||||
if (ret.Failed()) return ret;
|
if (ret.Failed()) return ret;
|
||||||
|
|
||||||
{
|
/* See if this is a valid track combination for signals (no overlap) */
|
||||||
/* See if this is a valid track combination for signals, (ie, no overlap) */
|
if (TracksOverlap(GetTrackBits(tile))) return_cmd_error(STR_ERROR_NO_SUITABLE_RAILROAD_TRACK);
|
||||||
TrackBits trackbits = GetTrackBits(tile);
|
|
||||||
if (KillFirstBit(trackbits) != TRACK_BIT_NONE && // More than one track present
|
|
||||||
trackbits != TRACK_BIT_HORZ &&
|
|
||||||
trackbits != TRACK_BIT_VERT) {
|
|
||||||
return_cmd_error(STR_ERROR_NO_SUITABLE_RAILROAD_TRACK);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* In case we don't want to change an existing signal, return without error. */
|
/* In case we don't want to change an existing signal, return without error. */
|
||||||
if (HasBit(p1, 17) && HasSignalOnTrack(tile, track)) return CommandCost();
|
if (HasBit(p1, 17) && HasSignalOnTrack(tile, track)) return CommandCost();
|
||||||
|
Loading…
Reference in New Issue
Block a user