Skip to content
Permalink
Browse files
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.
  • Loading branch information
sfan5 committed Sep 23, 2017
1 parent 5a3b8e3 commit d5a97e00eaac54def16fb53b68cfed7300af0854
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
@@ -2313,6 +2313,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;
@@ -63,7 +63,8 @@ class VoxelManipulator;
#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

3 comments on commit d5a97e0

@paramat
Copy link
Contributor

@paramat paramat commented on d5a97e0 Sep 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sfan5 Fixes #5408 ?

@nerzhul
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it just permit to trigger a save

@HybridDog
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the bug happened when rejoining

Please sign in to comment.