diff options
author | yexo <yexo@openttd.org> | 2010-02-25 20:06:11 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-02-25 20:06:11 +0000 |
commit | 7ff55502f04f9f75b01879ea04518c14d4706046 (patch) | |
tree | f48f911cf9861a0053bd35b92bf1e0ece0a5bf58 /src/saveload | |
parent | a9c8dbc0a0e1f1fc4434cf0c83ff658ab8d9e3d9 (diff) | |
download | openttd-7ff55502f04f9f75b01879ea04518c14d4706046.tar.xz |
(svn r19256) -Codechange: use a constructor/destructor for GRFConfig to make sure all members are properly initialized
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/newgrf_sl.cpp | 2 | ||||
-rw-r--r-- | src/saveload/oldloader_sl.cpp | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/saveload/newgrf_sl.cpp b/src/saveload/newgrf_sl.cpp index 9209be7b8..efeeee923 100644 --- a/src/saveload/newgrf_sl.cpp +++ b/src/saveload/newgrf_sl.cpp @@ -44,7 +44,7 @@ static void Load_NGRF() { ClearGRFConfigList(&_grfconfig); while (SlIterateArray() != -1) { - GRFConfig *c = CallocT<GRFConfig>(1); + GRFConfig *c = new GRFConfig(); SlObject(c, _grfconfig_desc); if (CheckSavegameVersion(101)) c->windows_paletted = (_use_palette == PAL_WINDOWS); AppendToGRFConfigList(&_grfconfig, c); diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp index 004c98ff6..b2eec5a1a 100644 --- a/src/saveload/oldloader_sl.cpp +++ b/src/saveload/oldloader_sl.cpp @@ -1519,9 +1519,8 @@ static bool LoadTTDPatchExtraChunks(LoadgameState *ls, int num) uint32 grfid = ReadUint32(ls); if (ReadByte(ls) == 1) { - GRFConfig *c = CallocT<GRFConfig>(1); + GRFConfig *c = new GRFConfig("TTDP game, no information"); c->ident.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->ident.grfid)); |