summaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-02-04 11:28:12 +0000
committerpeter1138 <peter1138@openttd.org>2008-02-04 11:28:12 +0000
commita528dc89c7a93fd6ee17498129a6148cd97964ed (patch)
treef7db516aadbc810aeb4f07d3c76ab35a6ed475b3 /src/engine.cpp
parent2588879c6d266741b1a9f6a38593d8a3a717a760 (diff)
downloadopenttd-a528dc89c7a93fd6ee17498129a6148cd97964ed.tar.xz
(svn r12054) -Cleanup: Use VehicleType instead of byte for vehicle types...
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index 9ef09432d..c6b776667 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -403,22 +403,19 @@ CommandCost CmdRenameEngine(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
}
-/*
- * returns true if an engine is valid, of the specified type, and buildable by
- * 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
+/** Check if an engine is buildable.
+ * @param engine index of the engine to check.
+ * @param type the type the engine should be.
+ * @param player index of the player.
+ * @return True if an engine is valid, of the specified type, and buildable by
+ * the given player.
*/
-bool IsEngineBuildable(EngineID engine, byte type, PlayerID player)
+bool IsEngineBuildable(EngineID engine, VehicleType type, PlayerID player)
{
- const Engine *e;
-
/* check if it's an engine that is in the engine array */
if (!IsEngineIndex(engine)) return false;
- e = GetEngine(engine);
+ const Engine *e = GetEngine(engine);
/* check if it's an engine of specified type */
if (e->type != type) return false;