From 4d0483b650c7625c6ea579eb880cbb9bede06d54 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Thu, 26 Apr 2007 07:24:19 +0000 Subject: (svn r9718) -Fix: Don't allow building of rail vehicles whose railtype isn't available yet. This also affects the rail purchase window. --- src/engine.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/engine.cpp') diff --git a/src/engine.cpp b/src/engine.cpp index 41a7bbeaa..04f30689a 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -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; } -- cgit v1.2.3-54-g00ecf