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

oups :)

git-svn-id: http://svn.net-core.org/repos/t-engine4@5257 51575b47-30f0-44d4-a5cc-537603b46e54
parent 32b11e8f
No related branches found
No related tags found
No related merge requests found
......@@ -79,9 +79,9 @@ function _M:addEntity(e, after, no_error)
end
if self.entities[e.uid] and self.entities[e.uid] == e then return end
if self.entities[e.uid] then
if self.entities[e.uid] then
if self.remove_old_entity_on_duplicate then self:removeEntity(self.entities[e.uid], true) end
if no_error then return else error("Entity "..e.uid.."("..(e.name or "???")..") already present on the level") end
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
......
......@@ -78,7 +78,7 @@ end
--- Called when disarmed
function _M:onDisarm(x, y, who)
-- Let the actor gain exp
self:check("disarmed", x, y, who)
end
--- Called when triggered
......
......@@ -99,6 +99,9 @@ newEntity{ base = "TRAP_COMPLEX",
if self:reactionToward(who) < 0 then self.dam = self.dam * 1.5 end
return true
end,
disarmed = function(self, x, y, who)
game.level:removeEntity(self, true)
end,
canAct = false,
energy = {value=0},
act = function(self)
......@@ -132,6 +135,9 @@ newEntity{ base = "TRAP_COMPLEX",
self:firePoison()
return true
end,
disarmed = function(self, x, y, who)
game.level:removeEntity(self, true)
end,
canAct = false,
energy = {value=0},
firePoison = function(self)
......
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