Fix: Don't assume engclass 2 should be elrail. (#10315)

When disabling/enabling elrail, there is an assumption that `engclass` of 2
means the engine will run on elrail. While this holds for default engines,
NewGRFs can do other things.

To resolve this we store the intended railtype so that toggling elrail will
restore to the correct type.
This commit is contained in:
PeterN
2023-01-06 00:44:57 +00:00
committed by GitHub
parent 8f350c9ae6
commit 1b1aa682a6
4 changed files with 7 additions and 7 deletions

View File

@@ -9804,6 +9804,7 @@ static void AfterLoadGRFs()
e->info.climates = 0;
} else {
e->u.rail.railtype = railtype;
e->u.rail.intended_railtype = railtype;
}
}