1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add ignore_world_load_errors configuration option and provide better error messages

This commit is contained in:
Perttu Ahola 2012-06-04 22:34:22 +03:00
parent 1cd2076d42
commit f48882213e
5 changed files with 62 additions and 12 deletions

View file

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