summaryrefslogtreecommitdiff
path: root/src/rollback_interface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rollback_interface.cpp')
-rw-r--r--src/rollback_interface.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/rollback_interface.cpp b/src/rollback_interface.cpp
index e15fe3da3..b2eb2093c 100644
--- a/src/rollback_interface.cpp
+++ b/src/rollback_interface.cpp
@@ -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{