Fix self-targeting check in attack spell cast function
This commit is contained in:
parent
3838037006
commit
c1e5ba880d
@ -108,7 +108,7 @@ function attack:cast(caster, target)
|
|||||||
|
|
||||||
--- @type Character
|
--- @type Character
|
||||||
local targetCharacterId = Tree.level.characterGrid:get(target)
|
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]
|
local targetCharacter = Tree.level.characters[targetCharacterId]
|
||||||
targetCharacter:try(Tree.behaviors.stats, function(stats)
|
targetCharacter:try(Tree.behaviors.stats, function(stats)
|
||||||
stats.hp = stats.hp - 4
|
stats.hp = stats.hp - 4
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user