Skip to content
Snippets Groups Projects
Commit 470067e1 authored by dg's avatar dg
Browse files

oups

git-svn-id: http://svn.net-core.org/repos/t-engine4@5700 51575b47-30f0-44d4-a5cc-537603b46e54
parent 50ea0433
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,10 @@ module(..., package.seeall, class.make)
_M.resources_def = {}
local fast_cache = {}
setmetatable(fast_cache, {__mode="v"})
--- Defines resource
-- Static!
-- All actors will now have :getResourcename() and :incResourcename() methods as well as a .max_resourcename and .resourcename
......@@ -122,7 +126,8 @@ function _M:recomputeRegenResources()
end
fstr = fstr.." end"
self.regenResourcesFast = loadstring(fstr)()
if not fast_cache[fstr] then fast_cache[fstr] = loadstring(fstr)() end
self.regenResourcesFast = fast_cache[fstr]
end
--- Regen resources, shout be called in your actor's act() method
......
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