(svn r9718) -Fix: Don't allow building of rail vehicles whose railtype isn't available yet. This also affects the rail purchase window.
authorpeter1138
Thu, 26 Apr 2007 07:24:19 +0000
changeset 6530 06785f74984c
parent 6529 c572290f0cb9
child 6531 4445b25832c4
(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
--- a/src/engine.cpp	Thu Apr 26 06:49:32 2007 +0000
+++ b/src/engine.cpp	Thu Apr 26 07:24:19 2007 +0000
@@ -401,6 +401,12 @@
 	/* 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;
 }