Skip to content
Snippets Groups Projects
Commit d6e12f93 authored by DarkGod's avatar DarkGod
Browse files

Fixed devour life damage type

parent 82179945
No related branches found
No related tags found
No related merge requests found
......@@ -2725,7 +2725,7 @@ newDamageType{
projector = function(src, x, y, type, dam)
if _G.type(dam) == "number" then dam = {dam=dam} end
local target = game.level.map(x, y, Map.ACTOR) -- Get the target first to make sure we heal even on kill
dam.dam = math.max(0, math.min(target.life, dam.dam))
if target then dam.dam = math.max(0, math.min(target.life, dam.dam)) end
local realdam = DamageType:get(DamageType.PHYSICAL).projector(src, x, y, DamageType.PHYSICAL, dam.dam)
if target and realdam > 0 then
local heal = realdam * (dam.healfactor or 1)
......
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