summaryrefslogtreecommitdiff
path: root/src/rollback_interface.cpp
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2018-12-04 20:37:48 +0100
committerGitHub <noreply@github.com>2018-12-04 20:37:48 +0100
commit3d66622772e66154b7624957a27f9be54c4c7c28 (patch)
tree7ff32e791a39d302f6d1306089b95cb23ebba838 /src/rollback_interface.cpp
parentae8d14b009650f0fe019301123793312406556e4 (diff)
downloadminetest-3d66622772e66154b7624957a27f9be54c4c7c28.tar.gz
minetest-3d66622772e66154b7624957a27f9be54c4c7c28.tar.bz2
minetest-3d66622772e66154b7624957a27f9be54c4c7c28.zip
Send only changed node metadata to clients instead of whole mapblock (#5268)
Includes newer style changes and fixes by est31 Improve the block position de-serialization Add type NodeMetadataMap
Diffstat (limited to 'src/rollback_interface.cpp')
-rw-r--r--src/rollback_interface.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/rollback_interface.cpp b/src/rollback_interface.cpp
index fef5389c1..3ac15544c 100644
--- a/src/rollback_interface.cpp
+++ b/src/rollback_interface.cpp
@@ -168,17 +168,10 @@ bool RollbackAction::applyRevert(Map *map, InventoryManager *imgr, IGameDef *gam
meta->deSerialize(is, 1); // FIXME: version bump??
}
// Inform other things that the meta data has changed
- v3s16 blockpos = getContainerPos(p, MAP_BLOCKSIZE);
MapEditEvent event;
event.type = MEET_BLOCK_NODE_METADATA_CHANGED;
- event.p = blockpos;
+ event.p = p;
map->dispatchEvent(&event);
- // Set the block to be saved
- MapBlock *block = map->getBlockNoCreateNoEx(blockpos);
- if (block) {
- block->raiseModified(MOD_STATE_WRITE_NEEDED,
- MOD_REASON_REPORT_META_CHANGE);
- }
} catch (InvalidPositionException &e) {
infostream << "RollbackAction::applyRevert(): "
<< "InvalidPositionException: " << e.what()