diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-06-04 22:34:22 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-06-04 22:34:40 +0300 |
commit | f48882213e31c47660cf0c87df1e04e51db9b50a (patch) | |
tree | 36693dde9d144f41f228044b5f84479f3dd0016f /src/map.cpp | |
parent | 1cd2076d42d9f97c10984cce17645b2ee4905713 (diff) | |
download | minetest-f48882213e31c47660cf0c87df1e04e51db9b50a.tar.gz minetest-f48882213e31c47660cf0c87df1e04e51db9b50a.tar.bz2 minetest-f48882213e31c47660cf0c87df1e04e51db9b50a.zip |
Add ignore_world_load_errors configuration option and provide better error messages
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/map.cpp b/src/map.cpp index 10dba3de9..647b9fe15 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -3378,14 +3378,20 @@ void ServerMap::loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool } catch(SerializationError &e) { - infostream<<"WARNING: Invalid block data in database " - <<" (SerializationError). " - <<"what()="<<e.what() - <<std::endl; - //" Ignoring. A new one will be generated. - assert(0); + errorstream<<"Invalid block data in database" + <<" ("<<p3d.X<<","<<p3d.Y<<","<<p3d.Z<<")" + <<" (SerializationError): "<<e.what()<<std::endl; + + // TODO: Block should be marked as invalid in memory so that it is + // not touched but the game can run - // TODO: Copy to a backup database. + if(g_settings->getBool("ignore_world_load_errors")){ + errorstream<<"Ignoring block load error. Duck and cover! " + <<"(ignore_world_load_errors)"<<std::endl; + } else { + throw SerializationError("Invalid block data in database"); + //assert(0); + } } } |