1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-19 10:22:39 +01:00

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 Michael Lutz
parent f5193aeba2
commit 7ccfc4b143
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;
}
}