(svn r2432) Use GetEngine() instead of DEREF_ENGINE() or even _engines[]

This commit is contained in:
tron
2005-06-07 18:13:49 +00:00
parent d0cdb45b6c
commit fa8f46c0b7
16 changed files with 59 additions and 54 deletions

View File

@@ -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;