From 61bf843799a78d58b15b76a926b14bd9801fb8c6 Mon Sep 17 00:00:00 2001 From: JailGamer Date: Sun, 3 May 2026 20:38:00 +0200 Subject: [PATCH] =?UTF-8?q?[FIX]=20Canviat=20el=20mode=20de=20detecci?= =?UTF-8?q?=C3=B3=20de=20les=20escales?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/abad.lua | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/data/abad.lua b/data/abad.lua index 2eb3a91..5c772d3 100644 --- a/data/abad.lua +++ b/data/abad.lua @@ -128,7 +128,7 @@ function abad:draw() abad.respawning=abad.respawning-1 end - -- draw.rect(x+abad.bb.x,y+abad.bb.y,abad.bb.w,abad.bb.h,3) + draw.rect(x+abad.bb.x,y+abad.bb.y,abad.bb.w,abad.bb.h,3) end function abad_make_safe( force ) @@ -311,18 +311,29 @@ end function abad_in_stairs(next_x, next_y) next_x = next_x or 0 next_y = next_y or 0 - local x1_check = abad.x+abad.bb.x+next_x - local x2_check = abad.x+abad.bb.x+abad.bb.w+next_x + + -- local x1_check = abad.x+abad.bb.x+next_x + -- local x2_check = abad.x+abad.bb.x+abad.bb.w+next_x + -- local y1_check = abad.y+next_y + -- local y2_check = abad.y+abad.bb.h+next_y + -- + -- if arc_check_tile(x1_check, y1_check)==tiletype.stair or + -- arc_check_tile(x2_check, y1_check)==tiletype.stair or + -- arc_check_tile(x1_check, y2_check)==tiletype.stair or + -- arc_check_tile(x2_check, y2_check)==tiletype.stair + -- then + -- return true + -- end + + local x1_check = abad.x+(abad.w/2)+next_x local y1_check = abad.y+next_y local y2_check = abad.y+abad.bb.h+next_y if arc_check_tile(x1_check, y1_check)==tiletype.stair or - arc_check_tile(x2_check, y1_check)==tiletype.stair or - arc_check_tile(x1_check, y2_check)==tiletype.stair or - arc_check_tile(x2_check, y2_check)==tiletype.stair + arc_check_tile(x1_check, y2_check)==tiletype.stair then return true - end + end return false end @@ -344,14 +355,17 @@ function abad_advance() local step_length=abad.step_length; --lo que avança l'abad cada pas local limit=tiletype.block - if abad.update~=abad_state_walking then limit=tiletype.half end + if abad.update~=abad_state_walking then + limit=tiletype.half + end local x_check = abad.x+abad.bb.x+abad.bb.w+step_length if abad.flip then step_length = -step_length x_check = abad.x+abad.bb.x+step_length end - local y_check = abad.y+abad.bb.h-4 + -- local y_check = abad.y+abad.bb.h-4 + local y_check = abad.y+abad.bb.h-1 if arc_check_tile(x_check, y_check)