From b7373c3eb539aeb441b8061e8a1bc16f2890ddc4 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Fri, 2 Oct 2015 19:01:24 +0100 Subject: [PATCH] Check tile type in SignalStateCondition::IsSignalValid() This is to avoid triggering an assertion, particularly when clearing the program state in InitializeGame(), as the map has just been reset, or when deleting a signal referenced by a condition. --- src/programmable_signals.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/programmable_signals.cpp b/src/programmable_signals.cpp index c7d9e5d87c..58d8865919 100644 --- a/src/programmable_signals.cpp +++ b/src/programmable_signals.cpp @@ -129,7 +129,7 @@ SignalStateCondition::SignalStateCondition(SignalReference this_sig, bool SignalStateCondition::IsSignalValid() { if (IsValidTile(this->sig_tile)) { - if (HasSignalOnTrackdir(this->sig_tile, this->sig_track)) { + if (IsTileType(this->sig_tile, MP_RAILWAY) && HasSignalOnTrackdir(this->sig_tile, this->sig_track)) { return true; } else { Invalidate();