summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-01-16 17:44:59 +0000
committermaedhros <maedhros@openttd.org>2007-01-16 17:44:59 +0000
commit1770db53cae0eedb1eb97b63df120696a8186341 (patch)
tree8fb5b7f79aacbd5b8094f4873fd04e4668c1197c
parente4d48ab47142438f1e6430caf0d36ae7b240378e (diff)
downloadopenttd-1770db53cae0eedb1eb97b63df120696a8186341.tar.xz
(svn r8160) -Fix (r8151): Do not use HasSignals on tiles without railways.
-rw-r--r--src/rail_gui.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index 25318676d..012edea0f 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -183,7 +183,7 @@ static void GenericPlaceSignals(TileIndex tile)
if (!_remove_button_clicked) {
uint32 p1 = _ctrl_pressed ? 8 : 0;
- if (!HasSignals(tile) && _cur_year < _patches.semaphore_build_before) {
+ if (IsTileType(tile, MP_RAILWAY) && !HasSignals(tile) && _cur_year < _patches.semaphore_build_before) {
/* Reverse the logic, so semaphores are normally built, and light
* signals can be built with ctrl held down. */
p1 = _ctrl_pressed ? 0 : 8;
@@ -374,7 +374,8 @@ static void HandleAutoSignalPlacement(void)
return;
}
- if (!HasSignals(TileVirtXY(thd->selstart.x, thd->selstart.y)) && _cur_year < _patches.semaphore_build_before) {
+ TileIndex start_tile = TileVirtXY(thd->selstart.x, thd->selstart.y);
+ if (IsTileType(start_tile, MP_RAILWAY) && !HasSignals(start_tile) && _cur_year < _patches.semaphore_build_before) {
/* Reverse the logic, so semaphores are normally built, and light
* signals can be built with ctrl held down. */
semaphore = _ctrl_pressed ? 0 : 1;
@@ -383,7 +384,7 @@ static void HandleAutoSignalPlacement(void)
// _patches.drag_signals_density is given as a parameter such that each user in a network
// game can specify his/her own signal density
DoCommandP(
- TileVirtXY(thd->selstart.x, thd->selstart.y),
+ start_tile,
TileVirtXY(thd->selend.x, thd->selend.y),
(semaphore << 3) | (trackstat << 4) | (_patches.drag_signals_density << 24),
CcPlaySound1E,