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

Trap cost is not refunded if the trap was triggered

git-svn-id: http://svn.net-core.org/repos/t-engine4@6720 51575b47-30f0-44d4-a5cc-537603b46e54
parent d750a794
No related branches found
No related tags found
No related merge requests found
......@@ -212,11 +212,13 @@ local basetrap = function(self, t, x, y, dur, add)
self:useEnergy()
self.temporary = self.temporary - 1
if self.temporary <= 0 then
if game.level.map(self.x, self.y, engine.Map.TRAP) == self then game.level.map:remove(self.x, self.y, engine.Map.TRAP) end
game.level:removeEntity(self)
if self.summoner and self.stamina then -- Refund
self.summoner:incStamina(self.stamina * 0.8)
if game.level.map(self.x, self.y, engine.Map.TRAP) == self then
game.level.map:remove(self.x, self.y, engine.Map.TRAP)
if self.summoner and self.stamina then -- Refund
self.summoner:incStamina(self.stamina * 0.8)
end
end
game.level:removeEntity(self)
end
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