mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix unused (and so, broken) enable_rollback_recording. This option must be reloaded at server loop but loaded when server starts, for data consistency (not a hot load variable)
ok @ShadowNinja
This commit is contained in:
parent
b019221c30
commit
27d4e89d32
5 changed files with 29 additions and 9 deletions
|
@ -44,6 +44,9 @@ int ModApiRollback::l_rollback_get_node_actions(lua_State *L)
|
|||
int limit = luaL_checknumber(L, 4);
|
||||
Server *server = getServer(L);
|
||||
IRollbackManager *rollback = server->getRollbackManager();
|
||||
if (rollback == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::list<RollbackAction> actions = rollback->getNodeActors(pos, range, seconds, limit);
|
||||
std::list<RollbackAction>::iterator iter = actions.begin();
|
||||
|
@ -80,6 +83,13 @@ int ModApiRollback::l_rollback_revert_actions_by(lua_State *L)
|
|||
int seconds = luaL_checknumber(L, 2);
|
||||
Server *server = getServer(L);
|
||||
IRollbackManager *rollback = server->getRollbackManager();
|
||||
|
||||
// If rollback is disabled, tell it's not a success.
|
||||
if (rollback == NULL) {
|
||||
lua_pushboolean(L, false);
|
||||
lua_newtable(L);
|
||||
return 2;
|
||||
}
|
||||
std::list<RollbackAction> actions = rollback->getRevertActions(actor, seconds);
|
||||
std::list<std::string> log;
|
||||
bool success = server->rollbackRevertActions(actions, &log);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue