--- deliantra/server/common/material.C 2009/11/29 10:55:18 1.8 +++ deliantra/server/common/material.C 2010/04/28 19:49:50 1.13 @@ -1,9 +1,9 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team - * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team - * Copyright (©) 1992,2007 Frank Tore Johansen + * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2002 Mark Wedel & Crossfire Development Team + * Copyright (©) 1992 Frank Tore Johansen * * Deliantra is free software: you can redistribute it and/or modify it under * the terms of the Affero GNU General Public License as published by the @@ -194,19 +194,15 @@ void load_materials () { - char filename[MAX_BUF]; - - sprintf (filename, "%s/materials", settings.datadir); - LOG (llevDebug, "Reading material type data from %s...\n", filename); - //TODO: somehow free old materials, or update them in-place + // currently we effectively leak them. material_null.next = 0; materialt = &material_null; - object_thawer thawer (filename); + object_thawer thawer (settings.datadir, "materials"); if (!thawer) { - LOG (llevError, "Cannot open %s for reading\n", filename); + LOG (llevError, "Cannot open %s for reading\n", thawer.name); goto done; } @@ -299,7 +295,7 @@ goto done; default: - if (!thawer.parse_error ("materials file", "materials")) + if (!thawer.parse_error ("materials file")) goto done; break; }