diff options
author | rubidium <rubidium@openttd.org> | 2010-08-10 15:54:53 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-08-10 15:54:53 +0000 |
commit | 29b489a055e12033b006410d5e67a493c64ccfe2 (patch) | |
tree | a0e8bee3d26a69341484ffe0461819e98fe1bf6f /src/newgrf.cpp | |
parent | 3d21fb44aae10d627cf24c7e42485c8f3a33ed42 (diff) | |
download | openttd-29b489a055e12033b006410d5e67a493c64ccfe2.tar.xz |
(svn r20437) -Codechange: lets Engines use GRFFilePropsBase as well
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r-- | src/newgrf.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 9d6deefdd..54506a07d 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -357,7 +357,7 @@ static Engine *GetNewEngine(const GRFFile *file, VehicleType type, uint16 intern EngineID engine = _engine_mngr.GetID(type, internal_id, scope_grfid); if (engine != INVALID_ENGINE) { Engine *e = Engine::Get(engine); - if (e->grffile == NULL) e->grffile = file; + if (e->grf_prop.grffile == NULL) e->grf_prop.grffile = file; return e; } } @@ -367,8 +367,8 @@ static Engine *GetNewEngine(const GRFFile *file, VehicleType type, uint16 intern if (engine != INVALID_ENGINE) { Engine *e = Engine::Get(engine); - if (e->grffile == NULL) { - e->grffile = file; + if (e->grf_prop.grffile == NULL) { + e->grf_prop.grffile = file; grfmsg(5, "Replaced engine at index %d for GRFID %x, type %d, index %d", e->index, BSWAP32(file->grfid), type, internal_id); } @@ -387,7 +387,7 @@ static Engine *GetNewEngine(const GRFFile *file, VehicleType type, uint16 intern /* ... it's not, so create a new one based off an existing engine */ Engine *e = new Engine(type, internal_id); - e->grffile = file; + e->grf_prop.grffile = file; /* Reserve the engine slot */ assert(_engine_mngr.Length() == e->index); @@ -6925,7 +6925,7 @@ static void CalculateRefitMasks() /* Did the newgrf specify any refitting? If not, use defaults. */ if (_gted[engine].refitmask_valid) { if (ei->refit_mask != 0) { - const GRFFile *file = e->grffile; + const GRFFile *file = e->grf_prop.grffile; if (file != NULL && file->cargo_max != 0) { /* Apply cargo translation table to the refit mask */ uint num_cargo = min(32, file->cargo_max); @@ -6987,7 +6987,7 @@ static void FinaliseEngineArray() Engine *e; FOR_ALL_ENGINES(e) { - if (e->grffile == NULL) { + if (e->grf_prop.grffile == NULL) { const EngineIDMapping &eid = _engine_mngr[e->index]; if (eid.grfid != INVALID_GRFID || eid.internal_id != eid.substitute_id) { e->info.string_id = STR_NEWGRF_INVALID_ENGINE; |