Changeset - r6530:7940d97af96d
[Not reviewed]
master
0 1 0
peter1138 - 17 years ago 2007-04-26 07:24:19
peter1138@openttd.org
(svn r9718) -Fix: Don't allow building of rail vehicles whose railtype isn't available yet. This also affects the rail purchase window.
1 file changed with 6 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/engine.cpp
Show inline comments
 
@@ -401,6 +401,12 @@ bool IsEngineBuildable(EngineID engine, 
 
	/* 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;
 
}
 

	
0 comments (0 inline, 0 general)