Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Myk <[email protected]>
  • Loading branch information
realSquidCoder and myk002 authored Jan 15, 2025
1 parent 74c2845 commit 950d951
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/dev/Lua API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -771,9 +771,9 @@ arbitrary Lua tables.
Same semantics as for the ``Site`` functions, but will associated the data
with the global world context.

* ``dfhack.persistent.getUnsavedSecs()``
* ``dfhack.persistent.getUnsavedSeconds()``

Returns the number of seconds since last save or load of a save
Returns the number of seconds since last save or load of a save.

The data is kept in memory, so no I/O occurs when getting or saving keys. It is
all written to a json file in the game save directory when the game is saved.
Expand Down
4 changes: 2 additions & 2 deletions library/LuaApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ static int dfhack_persistent_delete_world_data(lua_State *L) {
return delete_site_data(L, get_world_data);
}

static int dfhack_persistent_get_last_save_time(lua_State *L) {
static int dfhack_persistent_get_unsaved_seconds(lua_State *L) {
lua_pushinteger(L, Persistence::getUnsavedSeconds());
return 1;
}
Expand All @@ -365,7 +365,7 @@ static const luaL_Reg dfhack_persistent_funcs[] = {
{ "getWorldDataString", dfhack_persistent_get_world_data_string },
{ "saveWorldDataString", dfhack_persistent_save_world_data_string },
{ "deleteWorldData", dfhack_persistent_delete_world_data },
{ "getUnsavedSeconds", dfhack_persistent_get_last_save_time },
{ "getUnsavedSeconds", dfhack_persistent_get_unsaved_seconds },
{ NULL, NULL }
};

Expand Down

0 comments on commit 950d951

Please sign in to comment.