From: Perttu Ahola Date: Sun, 10 Apr 2011 21:19:40 +0000 (+0300) Subject: improved old map support X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=32360321018b83cb7b2c2018f6f477c70b9f633b;p=zefram%2Fminetest%2Fminetest_engine.git improved old map support --- diff --git a/src/map.cpp b/src/map.cpp index 5ab7e5b0..ff823af9 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -5121,14 +5121,31 @@ MapSector* ServerMap::loadSectorMeta(std::string dirname) // Get destination v2s16 p2d = getSectorPos(dirname); std::string dir = m_savedir + "/sectors/" + dirname; + + ServerMapSector *sector = NULL; std::string fullpath = dir + "/meta"; std::ifstream is(fullpath.c_str(), std::ios_base::binary); if(is.good() == false) - throw FileNotGoodException("Cannot open sector metafile"); - - ServerMapSector *sector = ServerMapSector::deSerialize - (is, this, p2d, m_sectors); + { + // If the directory exists anyway, it probably is in some old + // format. Just go ahead and create the sector. + if(fs::PathExists(dir)) + { + dstream<<"ServerMap::loadSectorMeta(): Sector metafile " + <differs_from_disk = false;