From 163e122b9743ed51a11198cd2420ebdb018d7611 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 24 Aug 2019 21:49:16 +0200 Subject: [PATCH] fix(cbs): fix a crash when the character try to go to its position --- sonic-radiance.love/datas/gamedata/skills/spinattack.lua | 6 +++--- sonic-radiance.love/scenes/battlesystem/actors/hero.lua | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sonic-radiance.love/datas/gamedata/skills/spinattack.lua b/sonic-radiance.love/datas/gamedata/skills/spinattack.lua index f73e0e7..4bb67db 100644 --- a/sonic-radiance.love/datas/gamedata/skills/spinattack.lua +++ b/sonic-radiance.love/datas/gamedata/skills/spinattack.lua @@ -2,14 +2,14 @@ return { name = "spinattack", cost = 05, target = nil, -- No targeting capacity - effectArea = {1, 0, "line", 5, true}, -- which area is affected by the attack + effectArea = {0, 0, "line", 5, true}, -- which area is affected by the attack choregraphy = { {"setAnimation", "none", "spindash", false}, {"wait", "none", 0.5}, {"setAnimation", "none", "spin", false}, {"dashForward", "none", 12, true}, - {'sendDamage', 120, 100, false, false}, - {'addGFX', "sentDamage", 'hitGFX', 0.75, 0, true, false}, + {'sendDamage', "none", 120, 100, false, false}, + {'addGFX', "sentDamage", 'hitGFX', 0, 0, true, false}, {'jumpBack', "none", true}, {'setAnimation', "none", 'idle', false}, } diff --git a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua index 172126b..2db6786 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua @@ -127,7 +127,9 @@ end function Hero:goTo(dx, dy, timerName, duration) local duration = self:getMovementDuration(dx, dy, duration) - self.tweens:newTween(0, duration, {x = dx, y = dy}, 'inOutQuad') + if duration > 0 then + self.tweens:newTween(0, duration, {x = dx, y = dy}, 'inOutQuad') + end self.tweens:newTimer(duration + 0.02, timerName) end