improvement(cbs): handle better when the character haven't moved

This commit is contained in:
Kazhnuz 2019-08-31 17:39:22 +02:00
parent daac217c6c
commit d097552298

View file

@ -252,9 +252,14 @@ function Hero:receiveSignal(action_type, id)
self.world.cursor:unset( )
self:useSkill(id, self.world.cursor.x, self.world.cursor.y)
elseif (action_type == "cursorMove") then
if (self.x ~= self.world.cursor.x) or (self.y ~= self.world.cursor.y) then
self:changeAnimation("walk", true)
self:goTo(self.world.cursor.x, self.world.cursor.y, 'cursorMove', 1)
self.assets.sfx["woosh"]:play()
else
self.world:resetActiveGrid()
self.scene.menu:set( self )
end
self.world.cursor:unset( )
else
self:switchActiveBattler( )
@ -263,10 +268,11 @@ end
function Hero:receiveBackSignal()
self.world.cursor:set(self.x, self.y, "cursorMove")
self:goTo(self.startx, self.starty, 'backMove', 1)
if (self.x ~= self.startx) or (self.y ~= self.starty) then
self.world.cursor:set(self.x, self.y, "cursorMove")
self.assets.sfx["woosh"]:play()
self:changeAnimation("walk")
end
end
function Hero:timerResponse(timer)