summaryrefslogtreecommitdiff
path: root/src/rail_cmd.cpp
diff options
context:
space:
mode:
authorrubidium42 <rubidium@openttd.org>2021-05-26 20:51:17 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-05-27 18:30:56 +0200
commitb791ffc6de6dcc33739bb36bec4824dc44417961 (patch)
tree0f3c42eee61630369a59623b36e0920fcecb9235 /src/rail_cmd.cpp
parenteaa3df1e8e3c9c6f6a22e95d0d4ed8ff251d4af9 (diff)
downloadopenttd-b791ffc6de6dcc33739bb36bec4824dc44417961.tar.xz
Fix: do not hide parameter by local variable with the same name
Diffstat (limited to 'src/rail_cmd.cpp')
-rw-r--r--src/rail_cmd.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 888b98e94..72ae0724c 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -1359,11 +1359,11 @@ static CommandCost CmdSignalTrackHelper(TileIndex tile, DoCommandFlag flags, uin
for (;;) {
/* only build/remove signals with the specified density */
if (remove || minimise_gaps || signal_ctr % signal_density == 0) {
- uint32 p1 = GB(TrackdirToTrack(trackdir), 0, 3);
- SB(p1, 3, 1, mode);
- SB(p1, 4, 1, semaphores);
- SB(p1, 5, 3, sigtype);
- if (!remove && signal_ctr == 0) SetBit(p1, 17);
+ uint32 param1 = GB(TrackdirToTrack(trackdir), 0, 3);
+ SB(param1, 3, 1, mode);
+ SB(param1, 4, 1, semaphores);
+ SB(param1, 5, 3, sigtype);
+ if (!remove && signal_ctr == 0) SetBit(param1, 17);
/* Pick the correct orientation for the track direction */
signals = 0;
@@ -1372,7 +1372,7 @@ static CommandCost CmdSignalTrackHelper(TileIndex tile, DoCommandFlag flags, uin
/* Test tiles in between for suitability as well if minimising gaps. */
bool test_only = !remove && minimise_gaps && signal_ctr < (last_used_ctr + signal_density);
- CommandCost ret = DoCommand(tile, p1, signals, test_only ? flags & ~DC_EXEC : flags, remove ? CMD_REMOVE_SIGNALS : CMD_BUILD_SIGNALS);
+ CommandCost ret = DoCommand(tile, param1, signals, test_only ? flags & ~DC_EXEC : flags, remove ? CMD_REMOVE_SIGNALS : CMD_BUILD_SIGNALS);
if (ret.Succeeded()) {
/* Remember last track piece where we can place a signal. */