X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Frollback_interface.cpp;h=fef5389c1c29b8f69ca9606fb7a354a9ce7ca1f2;hb=5f1cd555cd9d1c64426e173b30b5b792d211c835;hp=40a33a51da470010c3f4570dd53133d6ad1e10ce;hpb=072bbba69aa2528c309b76aaec288bdba52e119c;p=oweals%2Fminetest.git diff --git a/src/rollback_interface.cpp b/src/rollback_interface.cpp index 40a33a51d..fef5389c1 100644 --- a/src/rollback_interface.cpp +++ b/src/rollback_interface.cpp @@ -36,7 +36,7 @@ with this program; if not, write to the Free Software Foundation, Inc., RollbackNode::RollbackNode(Map *map, v3s16 p, IGameDef *gamedef) { - INodeDefManager *ndef = gamedef->ndef(); + const NodeDefManager *ndef = gamedef->ndef(); MapNode n = map->getNodeNoEx(p); name = ndef->get(n).name; param1 = n.param1; @@ -44,7 +44,7 @@ RollbackNode::RollbackNode(Map *map, v3s16 p, IGameDef *gamedef) NodeMetadata *metap = map->getNodeMetadata(p); if (metap) { std::ostringstream os(std::ios::binary); - metap->serialize(os); + metap->serialize(os, 1); // FIXME: version bump?? meta = os.str(); } } @@ -90,7 +90,7 @@ bool RollbackAction::isImportant(IGameDef *gamedef) const // If metadata differs, action is always important if(n_old.meta != n_new.meta) return true; - INodeDefManager *ndef = gamedef->ndef(); + const NodeDefManager *ndef = gamedef->ndef(); // Both are of the same name, so a single definition is needed const ContentFeatures &def = ndef->get(n_old.name); // If the type is flowing liquid, action is not important @@ -128,7 +128,7 @@ bool RollbackAction::applyRevert(Map *map, InventoryManager *imgr, IGameDef *gam case TYPE_NOTHING: return true; case TYPE_SET_NODE: { - INodeDefManager *ndef = gamedef->ndef(); + const NodeDefManager *ndef = gamedef->ndef(); // Make sure position is loaded from disk map->emergeBlock(getContainerPos(p, MAP_BLOCKSIZE), false); // Check current node @@ -165,7 +165,7 @@ bool RollbackAction::applyRevert(Map *map, InventoryManager *imgr, IGameDef *gam } } std::istringstream is(n_old.meta, std::ios::binary); - meta->deSerialize(is); + meta->deSerialize(is, 1); // FIXME: version bump?? } // Inform other things that the meta data has changed v3s16 blockpos = getContainerPos(p, MAP_BLOCKSIZE);