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:
parent
508b7b5e51
commit
a9d8df83d2
6 changed files with 150 additions and 44 deletions
|
@ -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{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue