Skip to content

Commit

Permalink
Fix blocks written by vmanip not being marked as modified
Browse files Browse the repository at this point in the history
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 d5a97e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/map.cpp
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/mapblock.h
Expand Up @@ -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
Expand Down

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.