From bddc0b183d8c70123cb1cf7c3c425a035a77bcf3 Mon Sep 17 00:00:00 2001 From: Axel Meyer Date: Sun, 10 May 2026 15:46:38 +0200 Subject: [PATCH] refactor(audit-M3): use engine.spatial.pixel_to_tile instead of math.floor --- init.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 85dcef6..9b984e7 100644 --- a/init.lua +++ b/init.lua @@ -72,8 +72,7 @@ local function can_occupy(x, y) {x + player.w - 1, y + player.h - 1}, } for _, c in ipairs(corners) do - local tx = math.floor(c[1] / ts) - local ty = math.floor(c[2] / ts) + local tx, ty = engine.spatial.pixel_to_tile(c[1], c[2], ts) if not maps.is_walkable(tx, ty) then return false end end return true