diff options
author | Darkvater <darkvater@openttd.org> | 2007-02-22 16:16:44 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2007-02-22 16:16:44 +0000 |
commit | 31be3c6fac70752f97b81490b3aa0f0d3d6c0764 (patch) | |
tree | 193b4d1c17fae519d21ba6f62142a9f496fe834b /src/oldloader.cpp | |
parent | c8343206115a50afb27743937d6c477516cbfdb2 (diff) | |
download | openttd-31be3c6fac70752f97b81490b3aa0f0d3d6c0764.tar.xz |
(svn r8844) -Revert partly (r8820, r8806): Change AppendToGRFConfigList to add the allocated GRFConfig to its list and not copy it.
Diffstat (limited to 'src/oldloader.cpp')
-rw-r--r-- | src/oldloader.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/oldloader.cpp b/src/oldloader.cpp index 82c7d8493..76b74620d 100644 --- a/src/oldloader.cpp +++ b/src/oldloader.cpp @@ -1367,18 +1367,16 @@ static bool LoadTTDPatchExtraChunks(LoadgameState *ls, int num) ReadUint32(ls); ReadByte(ls); len -= 5; ClearGRFConfigList(&_grfconfig); - GRFConfig c; - memset(&c, 0, sizeof(GRFConfig)); - while (len != 0) { uint32 grfid = ReadUint32(ls); if (ReadByte(ls) == 1) { - c.grfid = grfid; - c.filename = "TTDP game, no information"; + GRFConfig *c = CallocT<GRFConfig>(1); + c->grfid = grfid; + c->filename = strdup("TTDP game, no information"); - AppendToGRFConfigList(&_grfconfig, &c); - DEBUG(oldloader, 3, "TTDPatch game using GRF file with GRFID %0X", BSWAP32(c.grfid)); + AppendToGRFConfigList(&_grfconfig, c); + DEBUG(oldloader, 3, "TTDPatch game using GRF file with GRFID %0X", BSWAP32(c->grfid)); } len -= 5; }; |