summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-01-12 21:01:27 +0000
committerpeter1138 <peter1138@openttd.org>2008-01-12 21:01:27 +0000
commit4bbe6358d9e40013f81b632c5a73eea8cd55675d (patch)
tree967d56725a56de09fae5f40b549cfb74165f218f /src
parent0f7392bd616e0bd256b5ec241ad52d7230bcc454 (diff)
downloadopenttd-4bbe6358d9e40013f81b632c5a73eea8cd55675d.tar.xz
(svn r11823) -Fix (r11822): Custom names from old TTD games were not updated.
Diffstat (limited to 'src')
-rw-r--r--src/engine.h2
-rw-r--r--src/oldloader.cpp9
2 files changed, 8 insertions, 3 deletions
diff --git a/src/engine.h b/src/engine.h
index be8eb397e..6b5a4d833 100644
--- a/src/engine.h
+++ b/src/engine.h
@@ -212,8 +212,6 @@ static inline Engine* GetEngine(EngineID i)
return &_engines[i];
}
-VARDEF StringID _engine_name_strings[TOTAL_NUM_ENGINES];
-
static inline bool IsEngineIndex(uint index)
{
return index < TOTAL_NUM_ENGINES;
diff --git a/src/oldloader.cpp b/src/oldloader.cpp
index 27e7fab43..bf2000506 100644
--- a/src/oldloader.cpp
+++ b/src/oldloader.cpp
@@ -1306,6 +1306,13 @@ static bool LoadOldEngine(LoadgameState *ls, int num)
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 @@ static const OldChunks main_chunk[] = {
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