Skip to content
Snippets Groups Projects
Commit 91dc60a6 authored by dg's avatar dg
Browse files

Fix profiles data "leaking" into globals (this fixed the Blood of Life)

git-svn-id: http://svn.net-core.org/repos/t-engine4@1100 51575b47-30f0-44d4-a5cc-537603b46e54
parent 60e9d3bc
No related branches found
No related tags found
No related merge requests found
......@@ -144,6 +144,7 @@ function _M:saveGenericProfile(name, data, nosync)
-- Check for readability
local f, err = loadstring(data)
setfenv(f, {})
if not f then print("[PROFILES] cannot save generic data ", name, data, "it does not parse:") error(err) end
local ok, err = pcall(f)
if not ok and err then print("[PROFILES] cannot save generic data", name, data, "it does not parse") error(err) end
......@@ -166,6 +167,7 @@ function _M:saveModuleProfile(name, data, module, nosync)
-- Check for readability
local f, err = loadstring(data)
setfenv(f, {})
if not f then print("[PROFILES] cannot save module data ", name, data, "it does not parse:") error(err) end
local ok, err = pcall(f)
if not ok and err then print("[PROFILES] cannot save module data", name, data, "it does not parse") error(err) end
......@@ -317,4 +319,4 @@ function _M:checkFirstRun()
self:saveGenericProfile("firstrun", firstrun, false)
end
return result
end
\ No newline at end of file
end
......@@ -76,13 +76,6 @@ function _M:init(t, no_default)
engine.interface.PlayerHotkeys.init(self, t)
mod.class.interface.PlayerLore.init(self, t)
local mt = getmetatable(self)
mt.__newindex = function(t, k, v)
rawset(t, k, v)
print("===set===", k, v)
util.show_backtrace()
end
self.descriptor = {}
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment