Made persist-table correctly clear its stuff after exiting a game.

develop
expwnent 2014-11-10 01:09:50 -05:00
parent 593424cd6d
commit 828852c36f
1 changed files with 7 additions and 0 deletions

@ -4,6 +4,13 @@ local _ENV = mkmodule('persist-table')
symbols = symbols or {}
symbolCount = symbolCount or {}
dfhack.onStateChange.persistTable = function(state)
if state == SC_WORLD_UNLOADED then
symbols = {}
symbolCount = {}
end
end
function ensure(name)
return dfhack.persistent.save({key=name})
end