aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2017-09-23 17:05:55 +0200
committerSmallJoker <mk939@ymail.com>2018-06-03 17:31:59 +0200
commit01b9da870b8501395125f3181cb5893da39831bb (patch)
treee7e7e0c8fd37cf1dcef6892572c8e9ba3a45ab8e
parente8286e8894cf132eeda4bac9924e5fd8c74a7eb2 (diff)
downloadminetest-01b9da870b8501395125f3181cb5893da39831bb.tar.gz
minetest-01b9da870b8501395125f3181cb5893da39831bb.tar.bz2
minetest-01b9da870b8501395125f3181cb5893da39831bb.zip
Fix blocks written by vmanip not being marked as modified
This bug can be triggered by e.g. calling minetest.place_schematic() and stopping the server immediately afterwards.
-rw-r--r--src/map.cpp1
-rw-r--r--src/mapblock.h3
2 files changed, 3 insertions, 1 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 3b02ac02f..0c57d6a8a 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -2737,6 +2737,7 @@ void MMVManip::blitBackAll(std::map<v3s16, MapBlock*> *modified_blocks,
continue;
block->copyFrom(*this);
+ block->raiseModified(MOD_STATE_WRITE_NEEDED, MOD_REASON_VMANIP);
if(modified_blocks)
(*modified_blocks)[p] = block;
diff --git a/src/mapblock.h b/src/mapblock.h
index 8816dc817..1ccaccaef 100644
--- a/src/mapblock.h
+++ b/src/mapblock.h
@@ -122,7 +122,8 @@ public:
#define MOD_REASON_STATIC_DATA_REMOVED (1 << 16)
#define MOD_REASON_STATIC_DATA_CHANGED (1 << 17)
#define MOD_REASON_EXPIRE_DAYNIGHTDIFF (1 << 18)
-#define MOD_REASON_UNKNOWN (1 << 19)
+#define MOD_REASON_VMANIP (1 << 19)
+#define MOD_REASON_UNKNOWN (1 << 20)
////
//// MapBlock itself