fix(cbs): fix a crash when the character try to go to its position

This commit is contained in:
Kazhnuz 2019-08-24 21:49:16 +02:00
parent 3d269dca4a
commit 163e122b97
2 changed files with 6 additions and 4 deletions

View file

@ -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},
}

View file

@ -127,7 +127,9 @@ end
function Hero:goTo(dx, dy, timerName, duration)
local duration = self:getMovementDuration(dx, dy, duration)
if duration > 0 then
self.tweens:newTween(0, duration, {x = dx, y = dy}, 'inOutQuad')
end
self.tweens:newTimer(duration + 0.02, timerName)
end