From 5453857896ae29d62946a98f5b9dfb6cc5fa4efe Mon Sep 17 00:00:00 2001 From: JailGamer Date: Fri, 15 May 2026 23:19:43 +0200 Subject: [PATCH] [FIX] L'Abad ja s'enganxa be a les escales --- data/abad.lua | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/data/abad.lua b/data/abad.lua index 430782e..978de63 100644 --- a/data/abad.lua +++ b/data/abad.lua @@ -311,6 +311,7 @@ end function abad_in_stairs(next_x, next_y) next_x = next_x or 0 next_y = next_y or 0 + local result = false -- local x1_check = abad.x+abad.bb.x+next_x -- local x2_check = abad.x+abad.bb.x+abad.bb.w+next_x @@ -332,10 +333,12 @@ function abad_in_stairs(next_x, next_y) if arc_check_tile(x1_check, y1_check)==tiletype.stair or arc_check_tile(x1_check, y2_check)==tiletype.stair then - return true + result = true end - return false + if result then print("IN STAIRS "..next_x.." "..next_y) else print("-") end + + return result end function abad_in_floor(next_x, next_y) @@ -394,6 +397,14 @@ function abad_advance() abad.hab = hab end +function abad_move_down() + if abad_in_stairs() then + abad.update=abad_state_stairs + else + abad.update=abad_state_crouch + end +end + -- Controlador principal de l'abad function abad_state_normal() abad.frame=0 @@ -423,11 +434,7 @@ function abad_state_normal() if controller:check("up") and abad_in_stairs() then abad.update=abad_state_stairs elseif controller:check("down") then - if abad_in_stairs() then - abad.update=abad_state_stairs - else - abad.update=abad_state_crouch - end + abad_move_down() elseif controller:check("right") then abad.update=abad_state_walking abad.flip=false @@ -512,7 +519,7 @@ function abad_state_walking() abad_do_jump(true); -- jumping forward return elseif controller:check("down") then - abad.update=abad_state_crouch + abad_move_down() elseif controller:check("shoot") then abad_shot_cacau() end