mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
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:
parent
41a818cb7d
commit
b7373c3eb5
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user