mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-08 23:19:40 +00:00
(svn r9718) -Fix: Don't allow building of rail vehicles whose railtype isn't available yet. This also affects the rail purchase window.
This commit is contained in:
parent
5b5598b2a6
commit
4d0483b650
@ -401,6 +401,12 @@ bool IsEngineBuildable(EngineID engine, byte type, PlayerID player)
|
||||
/* check if it's available */
|
||||
if (!HASBIT(e->player_avail, player)) return false;
|
||||
|
||||
if (type == VEH_TRAIN) {
|
||||
/* Check if the rail type is available to this player */
|
||||
const Player *p = GetPlayer(player);
|
||||
if (!HASBIT(p->avail_railtypes, RailVehInfo(engine)->railtype)) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user