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

@ -1621,12 +1621,6 @@ void Map::transformLiquids(core::map<v3s16, MapBlock*> & modified_blocks)
DSTACK(__FUNCTION_NAME);
//TimeTaker timer("transformLiquids()");
/*
If something goes wrong, liquids are to blame
NOTE: Do not track liquids; it causes huge amounts of rollback log
*/
//RollbackScopeActor rollback_scope(m_gamedef->rollback(), "liquid");
u32 loopcount = 0;
u32 initial_size = m_transforming_liquid.size();
@ -1830,21 +1824,30 @@ void Map::transformLiquids(core::map<v3s16, MapBlock*> & modified_blocks)
n0.param2 = ~(LIQUID_LEVEL_MASK | LIQUID_FLOW_DOWN_MASK);
}
n0.setContent(new_node_content);
// Get old node for rollback
//RollbackNode rollback_oldnode(this, p0, m_gamedef);
// Set node
setNode(p0, n0);
// Report for rollback
/*if(m_gamedef->rollback())
{
// Find out whether there is a suspect for this action
std::string suspect;
if(m_gamedef->rollback()){
// Max. 5 seconds ago
suspect = m_gamedef->rollback()->getSuspect(p0, 5);
}
if(!suspect.empty()){
// Blame suspect
RollbackScopeActor rollback_scope(m_gamedef->rollback(), suspect, true);
// Get old node for rollback
RollbackNode rollback_oldnode(this, p0, m_gamedef);
// Set node
setNode(p0, n0);
// Report
RollbackNode rollback_newnode(this, p0, m_gamedef);
RollbackAction action;
action.setSetNode(p0, rollback_oldnode, rollback_newnode);
m_gamedef->rollback()->reportAction(action);
}*/
} else {
// Set node
setNode(p0, n0);
}
v3s16 blockpos = getNodeBlockPos(p0);
MapBlock *block = getBlockNoCreateNoEx(blockpos);