diff --git a/src/map.cpp b/src/map.cpp index 0e9b121d7..6147bb635 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -3344,19 +3344,27 @@ void ServerMap::saveBlock(MapBlock *block) std::string tmp = o.str(); const char *bytes = tmp.c_str(); - if(sqlite3_bind_int64(m_database_write, 1, getBlockAsInteger(p3d)) != SQLITE_OK) + bool success = true; + if(sqlite3_bind_int64(m_database_write, 1, getBlockAsInteger(p3d)) != SQLITE_OK) { infostream<<"WARNING: Block position failed to bind: "<resetModified(); + if (success) + block->resetModified(); } void ServerMap::loadBlock(std::string sectordir, std::string blockfile, MapSector *sector, bool save_after_load)