summaryrefslogtreecommitdiff
path: root/engine.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-12-03 15:48:21 +0000
committerpeter1138 <peter1138@openttd.org>2006-12-03 15:48:21 +0000
commite205c58ddc66684c24517cca5c94e41b767ae7d6 (patch)
tree7fff8ddf2fb4e34463baa3c967c238f272fe2720 /engine.c
parent3f3a14d24b95efe532e04c98ed5f568e97849fbb (diff)
downloadopenttd-e205c58ddc66684c24517cca5c94e41b767ae7d6.tar.xz
(svn r7330) -Fix (r7304): Data invalidation doesn't always happen as the local
player, resulting in an empty vehicle purchase list. Specify the player as an argument to IsEngineBuildable()
Diffstat (limited to 'engine.c')
-rw-r--r--engine.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/engine.c b/engine.c
index f2f903af3..d6acd5d05 100644
--- a/engine.c
+++ b/engine.c
@@ -401,12 +401,13 @@ int32 CmdRenameEngine(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
/*
* returns true if an engine is valid, of the specified type, and buildable by
- * the current player, false otherwise
+ * the given player, false otherwise
*
* engine = index of the engine to check
* type = the type the engine should be of (VEH_xxx)
+ * player = index of the player
*/
-bool IsEngineBuildable(uint engine, byte type)
+bool IsEngineBuildable(EngineID engine, byte type, PlayerID player)
{
const Engine *e;
@@ -419,7 +420,7 @@ bool IsEngineBuildable(uint engine, byte type)
if (e->type != type) return false;
// check if it's available
- if (!HASBIT(e->player_avail, _current_player)) return false;
+ if (!HASBIT(e->player_avail, player)) return false;
return true;
}