Fix regression in leveldb backend
parent
96f285f71e
commit
e14c4cdd4c
|
@ -100,8 +100,7 @@ MapBlock* Database_LevelDB::loadBlock(v3s16 blockpos)
|
||||||
std::string datastr;
|
std::string datastr;
|
||||||
leveldb::Status status = m_database->Get(leveldb::ReadOptions(),
|
leveldb::Status status = m_database->Get(leveldb::ReadOptions(),
|
||||||
i64tos(getBlockAsInteger(blockpos)), &datastr);
|
i64tos(getBlockAsInteger(blockpos)), &datastr);
|
||||||
ENSURE_STATUS_OK(status);
|
if (datastr.length() == 0 && status.ok()) {
|
||||||
if (datastr.length() == 0) {
|
|
||||||
errorstream << "Blank block data in database (datastr.length() == 0) ("
|
errorstream << "Blank block data in database (datastr.length() == 0) ("
|
||||||
<< blockpos.X << "," << blockpos.Y << "," << blockpos.Z << ")" << std::endl;
|
<< blockpos.X << "," << blockpos.Y << "," << blockpos.Z << ")" << std::endl;
|
||||||
|
|
||||||
|
@ -112,7 +111,8 @@ MapBlock* Database_LevelDB::loadBlock(v3s16 blockpos)
|
||||||
throw SerializationError("Blank block data in database");
|
throw SerializationError("Blank block data in database");
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
}
|
||||||
|
if (status.ok()) {
|
||||||
/*
|
/*
|
||||||
Make sure sector is loaded
|
Make sure sector is loaded
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue