Fix self-targeting check in attack spell cast function
This commit is contained in:
parent
3838037006
commit
c1e5ba880d
@ -102,13 +102,13 @@ function attack:cast(caster, target)
|
||||
return false
|
||||
end
|
||||
|
||||
caster:try(Tree.behaviors.stats, function (stats)
|
||||
caster:try(Tree.behaviors.stats, function(stats)
|
||||
stats.mana = stats.mana - 2
|
||||
end)
|
||||
|
||||
--- @type Character
|
||||
local targetCharacterId = Tree.level.characterGrid:get(target)
|
||||
if not targetCharacterId then return false end
|
||||
if not targetCharacterId or targetCharacterId == caster.id then return false end
|
||||
local targetCharacter = Tree.level.characters[targetCharacterId]
|
||||
targetCharacter:try(Tree.behaviors.stats, function(stats)
|
||||
stats.hp = stats.hp - 4
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user