summaryrefslogtreecommitdiff
path: root/engine.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-06-07 18:13:49 +0000
committertron <tron@openttd.org>2005-06-07 18:13:49 +0000
commitfa8f46c0b7f4723c12ddefd77d619ca98b6c7c6c (patch)
tree918dadd86e83f26d5de3c32831397bc35434bfa7 /engine.c
parentd0cdb45b6c634b4b7238f9b8b8cd9344cb7b1ac3 (diff)
downloadopenttd-fa8f46c0b7f4723c12ddefd77d619ca98b6c7c6c.tar.xz
(svn r2432) Use GetEngine() instead of DEREF_ENGINE() or even _engines[]
Diffstat (limited to 'engine.c')
-rw-r--r--engine.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/engine.c b/engine.c
index a055acf60..58a22b21d 100644
--- a/engine.c
+++ b/engine.c
@@ -839,7 +839,7 @@ int32 CmdWantEnginePreview(int x, int y, uint32 flags, uint32 p1, uint32 p2)
Engine *e;
if (!IsEngineIndex(p1)) return CMD_ERROR;
- e = DEREF_ENGINE(p1);
+ e = GetEngine(p1);
if (GetBestPlayer(e->preview_player) != _current_player) return CMD_ERROR;
if (flags & DC_EXEC)
@@ -1028,7 +1028,7 @@ static void Load_ENGN(void)
{
int index;
while ((index = SlIterateArray()) != -1) {
- SlObject(&_engines[index], _engine_desc);
+ SlObject(GetEngine(index), _engine_desc);
}
}
@@ -1057,7 +1057,7 @@ bool IsEngineBuildable(uint engine, byte type)
// check if it's an engine that is in the engine array
if (!IsEngineIndex(engine)) return false;
- e = DEREF_ENGINE(engine);
+ e = GetEngine(engine);
// check if it's an engine of specified type
if (e->type != type) return false;