refactor(audit-M3): use engine.spatial.pixel_to_tile instead of math.floor

This commit is contained in:
Axel Meyer
2026-05-10 15:46:38 +02:00
parent 9dd7f7c070
commit bddc0b183d

View File

@@ -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