summaryrefslogtreecommitdiff
path: root/src/oldloader.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-01-12 19:58:06 +0000
committerpeter1138 <peter1138@openttd.org>2008-01-12 19:58:06 +0000
commit0f7392bd616e0bd256b5ec241ad52d7230bcc454 (patch)
treef23fb584e594e0c9ff5a9ad650d97c493714078d /src/oldloader.cpp
parent74f9be8f2c1dca108b88449e6935c61442cbf829 (diff)
downloadopenttd-0f7392bd616e0bd256b5ec241ad52d7230bcc454.tar.xz
(svn r11822) -Codechange: Replaced fixed size custom name array. Names are now attached to their object directly and there is
no limit to the amount of names. -Fix: NewGRF engines could not be renamed.
Diffstat (limited to 'src/oldloader.cpp')
-rw-r--r--src/oldloader.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/oldloader.cpp b/src/oldloader.cpp
index 86782a263..27e7fab43 100644
--- a/src/oldloader.cpp
+++ b/src/oldloader.cpp
@@ -1235,7 +1235,8 @@ bool LoadOldVehicle(LoadgameState *ls, int num)
if (_old_next_ptr != 0xFFFF) v->next = GetVehiclePoolSize() <= _old_next_ptr ? new (_old_next_ptr) InvalidVehicle() : GetVehicle(_old_next_ptr);
- v->string_id = RemapOldStringID(_old_string_id);
+ _old_string_id = RemapOldStringID(_old_string_id);
+ v->name = CopyFromOldName(_old_string_id);
/* Vehicle-subtype is different in TTD(Patch) */
if (v->type == VEH_SPECIAL) v->subtype = v->subtype >> 1;
@@ -1251,7 +1252,7 @@ bool LoadOldVehicle(LoadgameState *ls, int num)
}
static const OldChunks sign_chunk[] = {
- OCL_SVAR( OC_UINT16, Sign, str ),
+ OCL_VAR ( OC_UINT16, 1, &_old_string_id ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_I32, Sign, x ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_I32, Sign, y ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_I8, Sign, z ),
@@ -1263,7 +1264,12 @@ static const OldChunks sign_chunk[] = {
static bool LoadOldSign(LoadgameState *ls, int num)
{
- return LoadChunk(ls, new (num) Sign(), sign_chunk);
+ if (!LoadChunk(ls, new (num) Sign(), sign_chunk)) return false;
+
+ _old_string_id = RemapOldStringID(_old_string_id);
+ // XXX copy if custom name$$$
+
+ return true;
}
static const OldChunks engine_chunk[] = {