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

hum

git-svn-id: http://svn.net-core.org/repos/t-engine4@5201 51575b47-30f0-44d4-a5cc-537603b46e54
parent 2feb6b19
No related branches found
No related tags found
No related merge requests found
......@@ -74,6 +74,7 @@ function _M:addEntity(e, after, no_error)
return
end
if self.entities[e.uid] and self.entities[e.uid] == e then return end
if self.entities[e.uid] then if no_error then return else error("Entity "..e.uid.."("..(e.name or "???")..") already present on the level") end end
self.entities[e.uid] = e
if e.addEntityOrder then after = e:addEntityOrder(level) end
......
......@@ -49,7 +49,7 @@ end
--- Can this object act at all
-- Most object will want to answer false, only recharging and stuff needs them
function _M:canAct()
if self.power_regen or self.use_talent or self.sentient then return true end
if (self.power_regen or self.use_talent or self.sentient) and not self.talent_cooldown then return true end
return false
end
......
......@@ -1325,6 +1325,7 @@ newEntity{ base = "BASE_LONGBOW",
act = function(self)
self:useEnergy()
if not self.worn_by then return end
if game.level and not game.level:hasEntity(self.worn_by) then self.worn_by = nil return end
if self.worn_by:attr("dead") then return end
self.zap = self.zap + 5
if not rng.percent(self.zap) then return end
......
......@@ -132,7 +132,7 @@ newTalent{
if not x then return nil end
local list = mod.class.NPC:loadList("/data/general/npcs/ghoul.lua")
local m = list.GHOUL
local m = list.GHOUL:clone()
if not m then return nil end
m:resolve() m:resolve(nil, true)
......
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