Fix LevelDB maps
authorSfan5 <sfan5@live.de>
Tue, 3 Dec 2013 19:03:20 +0000 (20:03 +0100)
committerSfan5 <sfan5@live.de>
Tue, 3 Dec 2013 19:03:20 +0000 (20:03 +0100)
src/database-leveldb.cpp

index 2a8f59c207996d83d6cea4129b7098ac5ca88bb0..0526b0b29318b439da4943bff548181aaaa6a188 100644 (file)
@@ -94,7 +94,7 @@ MapBlock* Database_LevelDB::loadBlock(v3s16 blockpos)
        std::string datastr;
        leveldb::Status s = m_database->Get(leveldb::ReadOptions(),
                i64tos(getBlockAsInteger(blockpos)), &datastr);
-       if (datastr.length() == 0) {
+       if (datastr.length() == 0 && s.ok()) {
                errorstream << "Blank block data in database (datastr.length() == 0) ("
                        << blockpos.X << "," << blockpos.Y << "," << blockpos.Z << ")" << std::endl;