From a9d8df83d228635594b75a563a0a8d906b3b883a Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Fri, 27 Jul 2012 13:24:28 +0300 Subject: Make the rollback system VERY FUCKING GOD DAMN POWERFUL --- src/rollback_interface.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/rollback_interface.cpp') 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{ -- cgit v1.2.3