fix(cbs): fix a crash when the character try to go to its position
This commit is contained in:
parent
3d269dca4a
commit
163e122b97
2 changed files with 6 additions and 4 deletions
|
@ -2,14 +2,14 @@ return {
|
||||||
name = "spinattack",
|
name = "spinattack",
|
||||||
cost = 05,
|
cost = 05,
|
||||||
target = nil, -- No targeting capacity
|
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 = {
|
choregraphy = {
|
||||||
{"setAnimation", "none", "spindash", false},
|
{"setAnimation", "none", "spindash", false},
|
||||||
{"wait", "none", 0.5},
|
{"wait", "none", 0.5},
|
||||||
{"setAnimation", "none", "spin", false},
|
{"setAnimation", "none", "spin", false},
|
||||||
{"dashForward", "none", 12, true},
|
{"dashForward", "none", 12, true},
|
||||||
{'sendDamage', 120, 100, false, false},
|
{'sendDamage', "none", 120, 100, false, false},
|
||||||
{'addGFX', "sentDamage", 'hitGFX', 0.75, 0, true, false},
|
{'addGFX', "sentDamage", 'hitGFX', 0, 0, true, false},
|
||||||
{'jumpBack', "none", true},
|
{'jumpBack', "none", true},
|
||||||
{'setAnimation', "none", 'idle', false},
|
{'setAnimation', "none", 'idle', false},
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,9 @@ end
|
||||||
|
|
||||||
function Hero:goTo(dx, dy, timerName, duration)
|
function Hero:goTo(dx, dy, timerName, duration)
|
||||||
local duration = self:getMovementDuration(dx, dy, duration)
|
local duration = self:getMovementDuration(dx, dy, duration)
|
||||||
|
if duration > 0 then
|
||||||
self.tweens:newTween(0, duration, {x = dx, y = dy}, 'inOutQuad')
|
self.tweens:newTween(0, duration, {x = dx, y = dy}, 'inOutQuad')
|
||||||
|
end
|
||||||
self.tweens:newTimer(duration + 0.02, timerName)
|
self.tweens:newTimer(duration + 0.02, timerName)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue