Skip to content

Commit

Permalink
Save walking state variables
Browse files Browse the repository at this point in the history
  • Loading branch information
vaartis committed Sep 6, 2020
1 parent 11be731 commit 3b6654f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lua/terminal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ local function save_game(first_line, last_line)
local saved_data = {
lines = { first_line = first_line._name, last_line = last_line._name },
variables = M.state_variables,
environment = { name = current_environment_name }
walking_variables = WalkingModule.state_variables,
environment = { name = current_environment_name },
}
for _, line in pairs(lines_to_save) do
local line_saved_fields = {}
Expand Down Expand Up @@ -143,6 +144,10 @@ local function load_game()

M.state_variables = util.deep_merge(M.state_variables, data["variables"])

if data["walking_variables"] then
WalkingModule.state_variables = util.deep_merge(WalkingModule.state_variables, data["walking_variables"])
end

if data.environment then
M.set_environment_image(data.environment.name)
end
Expand Down

0 comments on commit 3b6654f

Please sign in to comment.