Fix self-targeting check in attack spell cast function

This commit is contained in:
PeaAshMeter 2025-11-04 07:00:46 +03:00
parent 3838037006
commit c1e5ba880d

View File

@ -108,7 +108,7 @@ function attack:cast(caster, target)
--- @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