mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2025-12-30 03:51:40 +09:00
.
This commit is contained in:
@@ -67,8 +67,11 @@ if settings.startup['PHI-CT'].value then
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
function math2d.position.equal(p1, p2)
|
function math2d.position.equal(p1, p2)
|
||||||
p1, p2 = math2d.position.ensure_xy(p1), math2d.position.ensure_xy(p2)
|
-- Add nil check and explicit conversion
|
||||||
return p1.x == p2.x and p1.y == p2.y
|
p1 = math2d.position.ensure_xy(p1 or {x = 0, y = 0})
|
||||||
|
p2 = math2d.position.ensure_xy(p2 or {x = 0, y = 0})
|
||||||
|
-- Add floating point tolerance (1e-6) for coordinate comparison
|
||||||
|
return math.abs(p1.x - p2.x) < 1e-6 and math.abs(p1.y - p2.y) < 1e-6
|
||||||
end
|
end
|
||||||
|
|
||||||
function math2d.position.split(pos)
|
function math2d.position.split(pos)
|
||||||
|
|||||||
Reference in New Issue
Block a user