fix sprite side on attack

This commit is contained in:
neckrat 2025-11-10 07:20:46 +03:00
parent c16870102b
commit 59f1227033

View File

@ -124,6 +124,10 @@ function attack:cast(caster, target)
local targetSprite = targetCharacter:has(Tree.behaviors.sprite) local targetSprite = targetCharacter:has(Tree.behaviors.sprite)
if not sprite or not targetSprite then return true end if not sprite or not targetSprite then return true end
if sprite.side == targetSprite.side then
sprite.side = -sprite.side
end
AnimationNode { AnimationNode {
onEnd = function() caster:has(Tree.behaviors.spellcaster):endCast() end, onEnd = function() caster:has(Tree.behaviors.spellcaster):endCast() end,
children = { children = {