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

fix

git-svn-id: http://svn.net-core.org/repos/t-engine4@331 51575b47-30f0-44d4-a5cc-537603b46e54
parent 202b3c88
No related branches found
No related tags found
No related merge requests found
......@@ -79,6 +79,7 @@ function _M:cloned()
self.changed = true
end
_M.__autoload = {}
_M.loadNoDelay = true
--- If we are loaded we need a new uid
function _M:loaded()
......@@ -88,6 +89,9 @@ function _M:loaded()
next_uid = next_uid + 1
self.changed = true
-- hackish :/
if self.autoLoadedAI then self:autoLoadedAI() end
end
--- Change the entity's uid
......
require "engine.class"
require "engine.Actor"
local Map = require "engine.Map"
--- Handles actors artificial intelligence (or dumbness ... ;)
......@@ -30,6 +31,10 @@ end
function _M:init(t)
self.ai_state = {}
self.ai_target = {}
self:autoLoadedAI()
end
function _M:autoLoadedAI()
-- Make the table with weak values, so that threat list does not prevent garbage collection
setmetatable(self.ai_target, {__mode='v'})
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