1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Make the rollback system VERY FUCKING GOD DAMN POWERFUL

This commit is contained in:
Perttu Ahola 2012-07-27 13:24:28 +03:00
parent 508b7b5e51
commit a9d8df83d2
6 changed files with 150 additions and 44 deletions

View 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{