summaryrefslogtreecommitdiff
path: root/src/rollback_interface.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-07-27 13:24:28 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-07-27 13:24:28 +0300
commita9d8df83d228635594b75a563a0a8d906b3b883a (patch)
tree547e16d22ebef3e35a65e1dc3cf6368f5f5ec331 /src/rollback_interface.cpp
parent508b7b5e51bd2e193fb182bb9247555154d78087 (diff)
downloadminetest-a9d8df83d228635594b75a563a0a8d906b3b883a.tar.gz
minetest-a9d8df83d228635594b75a563a0a8d906b3b883a.tar.bz2
minetest-a9d8df83d228635594b75a563a0a8d906b3b883a.zip
Make the rollback system VERY FUCKING GOD DAMN POWERFUL
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{