Skip to content

Commit

Permalink
params save/load fix
Browse files Browse the repository at this point in the history
Changed MOD variable (which was previously set local) with another one.
  • Loading branch information
ZhilkinSerg committed Aug 12, 2017
1 parent 9909ef1 commit 602e80b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dda-lua/lua/params.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
local params = {}
local params = {

prefix = "dda-lua"

}

params.init = function()

Expand Down Expand Up @@ -76,7 +80,7 @@ params.save = function(parameter_name, parameter_value, parameter_type)

parameter_value = params.convert(parameter_value, "string") --passed to function `parameter_type` is ignored as we are always saving as string

player:set_value(MOD.id.."."..parameter_name, parameter_value)
player:set_value(params.prefix.."."..parameter_name, parameter_value)

LOG.message("params.save:END|%s|%s|%s", parameter_name, parameter_type, parameter_value)

Expand All @@ -88,7 +92,7 @@ params.load = function (parameter_name, parameter_type)

LOG.message("params.load:START|%s|%s", parameter_name, parameter_type)

local parameter_value = player:get_value(MOD.id.."."..parameter_name)
local parameter_value = player:get_value(params.prefix.."."..parameter_name)

parameter_value = params.convert(parameter_value, parameter_type)

Expand Down

0 comments on commit 602e80b

Please sign in to comment.