summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2006-01-29 10:50:27 +0000
committerDarkvater <Darkvater@openttd.org>2006-01-29 10:50:27 +0000
commit9eb158982746e1c2a5ef7b2a2d3ac10990f1273a (patch)
treed36bdea25b12aca0412b419292f6c0786256e35d
parentc75f8ae5ef25b5229cf56c364ef470f2691271ef (diff)
downloadopenttd-9eb158982746e1c2a5ef7b2a2d3ac10990f1273a.tar.xz
(svn r3466) - Codechange: Some changes to increase readability of signals code.
-rw-r--r--rail.h2
-rw-r--r--rail_cmd.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/rail.h b/rail.h
index c051a82c6..f5c109994 100644
--- a/rail.h
+++ b/rail.h
@@ -42,7 +42,7 @@ typedef enum RailTileSubtypes {
} RailTileSubtype;
typedef enum SignalTypes {
- /* Stored in m4[0..1] for MP_RAILWAY */
+ /* Stored in m4[0..2] for MP_RAILWAY */
SIGTYPE_NORMAL = 0, // normal signal
SIGTYPE_ENTRY = 1, // presignal block entry
SIGTYPE_EXIT = 2, // presignal block exit
diff --git a/rail_cmd.c b/rail_cmd.c
index 91ba791b1..ddea310b6 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -757,7 +757,7 @@ int32 CmdBuildSingleSignal(int x, int y, uint32 flags, uint32 p1, uint32 p2)
_m[tile].m5 |= RAIL_TYPE_SIGNALS; // change into signals
_m[tile].m2 |= 0xF0; // all signals are on
_m[tile].m3 &= ~0xF0; // no signals built by default
- _m[tile].m4 = semaphore ? 0x08 : 0;
+ _m[tile].m4 = semaphore ? SIG_SEMAPHORE_MASK : 0;
}
if (p2 == 0) {
@@ -767,7 +767,7 @@ int32 CmdBuildSingleSignal(int x, int y, uint32 flags, uint32 p1, uint32 p2)
} else {
if (pre_signal) {
// cycle between normal -> pre -> exit -> combo -> pbs ->...
- byte type = ((GetSignalType(tile, track) + 1) % 5);
+ byte type = (GetSignalType(tile, track) + 1) % SIGTYPE_END;
SB(_m[tile].m4, 0, 3, type);
} else {
// cycle between two-way -> one-way -> one-way -> ...