diff options
author | tron <tron@openttd.org> | 2006-03-17 06:26:37 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-17 06:26:37 +0000 |
commit | 4fb11f23adf3cb0100e39fc1fbf5b99c079781f4 (patch) | |
tree | 2070ee15ae157b6739ca7446e9e5e6bf73385c65 /rail_cmd.c | |
parent | 0e3699bd5c9af084f55a439eedee2647628caff3 (diff) | |
download | openttd-4fb11f23adf3cb0100e39fc1fbf5b99c079781f4.tar.xz |
(svn r3912) Move the signal type enum and GetSignalType() to rail_map.h; also add SetSignalType() and use the functions
Diffstat (limited to 'rail_cmd.c')
-rw-r--r-- | rail_cmd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/rail_cmd.c b/rail_cmd.c index a9913c7ce..f7d6d22b3 100644 --- a/rail_cmd.c +++ b/rail_cmd.c @@ -745,8 +745,9 @@ int32 CmdBuildSingleSignal(int x, int y, uint32 flags, uint32 p1, uint32 p2) } else { if (pre_signal) { // cycle between normal -> pre -> exit -> combo -> ... - byte type = (GetSignalType(tile, track) + 1) % SIGTYPE_END; - SB(_m[tile].m4, 0, 2, type); + SignalType type = GetSignalType(tile); + + SetSignalType(tile, type == SIGTYPE_COMBO ? SIGTYPE_NORMAL : type + 1); } else { // cycle between two-way -> one-way -> one-way -> ... /* TODO: Rewrite switch into something more general */ @@ -2035,7 +2036,7 @@ static void GetTileDesc_Track(TileIndex tile, TileDesc *td) STR_RAILROAD_TRACK_WITH_COMBOSIGNALS }; - td->str = signal_type[GB(_m[tile].m4, 0, 2)]; + td->str = signal_type[GetSignalType(tile)]; break; } |