]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/rollback_interface.cpp
Fix spaces float islands code
[dragonfireclient.git] / src / rollback_interface.cpp
index e15fe3da3155aba623589201fa98e9b2ce9edced..70a9e9457fe01e9a684cf4c66136cd8f8910e8df 100644 (file)
@@ -1,6 +1,6 @@
 /*
-Minetest-c55
-Copyright (C) 2012 celeron55, Perttu Ahola <celeron55@gmail.com>
+Minetest
+Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
@@ -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{