updated vector comparison

Co-authored-by: Chr1Z <97286811+Chr1Z93@users.noreply.github.com>
This commit is contained in:
YumiWhellie 2024-11-13 16:07:31 -03:00 committed by GitHub
parent a9c31630f0
commit 59f64415d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1185,12 +1185,10 @@ function modifySlot(newSlot, cardPosition)
table.insert(slotSnaps, snap)
end
end
cardPosition.x = tonumber(string.format("%.3f", cardPosition.x))
cardPosition.z = tonumber(string.format("%.3f", cardPosition.z))
cardPosition.y = 0
for snapId, snap in ipairs(slotSnaps) do
local snapPosX = tonumber(string.format("%.3f", snap.position.x))
local snapPosZ = tonumber(string.format("%.3f", snap.position.z))
if snapPosX == cardPosition.x and snapPosZ == cardPosition.z then
local snapPosition = Vector(snap.position.x, 0, snap.position.z)
if snapPosition == cardPosition then
slotData[snapId] = newSlot
if Player[playerColor].seated then
printToColor(newSlot .. " slot added to player mat", playerColor, Color.fromString(playerColor))