Fixed picking a card up while it is falling

This commit is contained in:
Chr1Z93 2024-11-21 00:20:35 +01:00
parent 2a778840b0
commit 225d9cbedb

View File

@ -2877,12 +2877,9 @@ function moveCardWithTokens(params)
Wait.condition( Wait.condition(
function() stopTokenTransformUpdating(card) end, function() stopTokenTransformUpdating(card) end,
function() function()
if card.held_by_color ~= nil then return true end
if card ~= nil and cardTokens[card] ~= nil and #cardTokens[card] ~= 0 then if card ~= nil and cardTokens[card] ~= nil and #cardTokens[card] ~= 0 then
updateTokenTransform(card) updateTokenTransform(card)
local cardVelocity = card.getVelocity():magnitude() return card.resting and not card.isSmoothMoving()
return (card.resting and not card.isSmoothMoving()) or (cardVelocity < 0.15 and cardVelocity > 0.05)
end end
return true return true
@ -2891,10 +2888,6 @@ function moveCardWithTokens(params)
end end
function storeTokenTransform(card) function storeTokenTransform(card)
if cardTokens[card] ~= nil then
stopTokenTransformUpdating(card)
end
cardTokens[card] = {} cardTokens[card] = {}
local cardRot = card.getRotation() local cardRot = card.getRotation()
for _, token in ipairs(searchLib.onObject(card, "isTileOrToken", 0.95)) do for _, token in ipairs(searchLib.onObject(card, "isTileOrToken", 0.95)) do