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.
This commit is contained in:
Jonathan G Rennison 2015-10-02 19:01:24 +01:00
parent 41a818cb7d
commit b7373c3eb5

View File

@ -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();