Mercurial > hg > openttd
changeset 8259:184c94f920a6 draft
(svn r11823) -Fix (r11822): Custom names from old TTD games were not updated.
author | peter1138 <peter1138@openttd.org> |
---|---|
date | Sat, 12 Jan 2008 21:01:27 +0000 |
parents | 6017c5ebeb7e |
children | 5b1a8515df51 |
files | src/engine.h src/oldloader.cpp |
diffstat | 2 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/engine.h +++ b/src/engine.h @@ -212,8 +212,6 @@ return &_engines[i]; } -VARDEF StringID _engine_name_strings[TOTAL_NUM_ENGINES]; - static inline bool IsEngineIndex(uint index) { return index < TOTAL_NUM_ENGINES;
--- a/src/oldloader.cpp +++ b/src/oldloader.cpp @@ -1306,6 +1306,13 @@ return true; } +static bool LoadOldEngineName(LoadgameState *ls, int num) +{ + Engine *e = GetEngine(num); + e->name = CopyFromOldName(RemapOldStringID(ReadUint16(ls))); + return true; +} + static const OldChunks subsidy_chunk[] = { OCL_SVAR( OC_UINT8, Subsidy, cargo_type ), OCL_SVAR( OC_UINT8, Subsidy, age ), @@ -1512,7 +1519,7 @@ OCL_NULL( 144 ), ///< cargo-stuff, calculated in InitializeLandscapeVariables - OCL_VAR ( OC_UINT16, 256, &_engine_name_strings[0] ), + OCL_CHUNK(256, LoadOldEngineName ), OCL_NULL( 144 ), ///< AI cargo-stuff, calculated in InitializeLandscapeVariables OCL_NULL( 2 ), ///< Company indexes of players, no longer in use