summaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-04-26 07:24:19 +0000
committerpeter1138 <peter1138@openttd.org>2007-04-26 07:24:19 +0000
commit4d0483b650c7625c6ea579eb880cbb9bede06d54 (patch)
treec1f2e9ede4e91d7c5f268ea367d0d27f955e6eeb /src/engine.cpp
parent5b5598b2a673844abb75c52e3deec073b912b865 (diff)
downloadopenttd-4d0483b650c7625c6ea579eb880cbb9bede06d54.tar.xz
(svn r9718) -Fix: Don't allow building of rail vehicles whose railtype isn't available yet. This also affects the rail purchase window.
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp6
1 files changed, 6 insertions, 0 deletions
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;
}