diff options
author | darkvater <darkvater@openttd.org> | 2004-08-13 17:41:44 +0000 |
---|---|---|
committer | darkvater <darkvater@openttd.org> | 2004-08-13 17:41:44 +0000 |
commit | ecb6f670b0dc4b522fd712657db125162689cf4f (patch) | |
tree | 357a96872ce27c40919c1919491972138e0356e1 | |
parent | 0c25a4b10ce61dad50f4e0c353fc582669d4f85f (diff) | |
download | openttd-ecb6f670b0dc4b522fd712657db125162689cf4f.tar.xz |
(svn r39) -Fix [1008605] Signals not updated after ClearTunnel Bug [985920] (TrueLight)
-rw-r--r-- | tunnelbridge_cmd.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c index 672936b36..4761c6013 100644 --- a/tunnelbridge_cmd.c +++ b/tunnelbridge_cmd.c @@ -630,10 +630,14 @@ static int32 DoClearTunnel(uint tile, uint32 flags) } if (flags & DC_EXEC) { + // We first need to request the direction before calling DoClearSquare + // else the direction is always 0.. dah!! ;) + byte tile_dir = _map5[tile]&3; + byte endtile_dir = _map5[endtile]&3; DoClearSquare(tile); DoClearSquare(endtile); - UpdateSignalsOnSegment(tile, _updsignals_tunnel_dir[_map5[tile]&3]); - UpdateSignalsOnSegment(endtile, _updsignals_tunnel_dir[_map5[endtile]&3]); + UpdateSignalsOnSegment(tile, _updsignals_tunnel_dir[tile_dir]); + UpdateSignalsOnSegment(endtile, _updsignals_tunnel_dir[endtile_dir]); if (_map_owner[tile] == OWNER_TOWN && _game_mode != GM_EDITOR) ChangeTownRating(t, -250, 0); } |