]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/rollback_interface.cpp
Clean up EmergeManager, do initial work on Mapgen configuration
[dragonfireclient.git] / src / rollback_interface.cpp
index e15fe3da3155aba623589201fa98e9b2ce9edced..b2eb2093c58118612f28cbf81d664d0e86c0f67f 100644 (file)
@@ -289,6 +289,24 @@ bool RollbackAction::isImportant(IGameDef *gamedef) const
        }
 }
 
+bool RollbackAction::getPosition(v3s16 *dst) const
+{
+       switch(type){
+       case RollbackAction::TYPE_SET_NODE:
+               if(dst) *dst = p;
+               return true;
+       case RollbackAction::TYPE_MODIFY_INVENTORY_STACK: {
+               InventoryLocation loc;
+               loc.deSerialize(inventory_location);
+               if(loc.type != InventoryLocation::NODEMETA)
+                       return false;
+               if(dst) *dst = loc.p;
+               return true; }
+       default:
+               return false;
+       }
+}
+
 bool RollbackAction::applyRevert(Map *map, InventoryManager *imgr, IGameDef *gamedef) const
 {
        try{