diff --git a/data.db b/data.db new file mode 100644 index 0000000..dd7330c --- /dev/null +++ b/data.db @@ -0,0 +1,11 @@ +{ + currency_unit = "dims", + materials = { + Steel = 0.0625, + Wood = 0.00390625, + }, + currencies = { + [ "Diamond(s)" ] = 1, + [ "Emerald(s)" ] = 0.01, + }, +} \ No newline at end of file diff --git a/stratum.lua b/stratum.lua index 0f8bb47..69b86b3 100644 --- a/stratum.lua +++ b/stratum.lua @@ -1,7 +1,6 @@ local backend = require("backends.meshnetBackend") local registeredTransforms = {} local message_queue = {} - local data = {} local function loadData() @@ -61,7 +60,13 @@ local function generateEnviorment() if not focus[indx] then focus[indx] = {} end focus = focus[indx] else - focus[indx] = function (...) return load(v.body,v.name,"t",env)({},...) end + if not v.func then + focus[indx] = function (...) return load(v.body,v.name,"t",env)({},...) end + v.func = focus[indx] + else + focus[indx] = setfenv(v.func,env) + v.func = focus[indx] + end end end end