(svn r8844) -Revert partly (r8820, r8806): Change AppendToGRFConfigList to add the allocated GRFConfig to its list and not copy it.

This commit is contained in:
Darkvater
2007-02-22 16:16:44 +00:00
parent c834320611
commit 31be3c6fac
3 changed files with 15 additions and 19 deletions

View File

@@ -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;
};