rotation fixed
This commit is contained in:
parent
24545fc389
commit
c3cdd2f050
@ -85,7 +85,7 @@ function takeCardIntoThreatArea(playerColor, hoveredObject)
|
||||
|
||||
-- work out the new rotation
|
||||
local matRotation = playermatApi.returnRotation(matColor)
|
||||
local newCardRot = cardRot:setAt("y", matRotation.y + cardRot.y - ownerRotation.y)
|
||||
local newCardRot = cardRot:setAt("y", roundToMultiple(matRotation.y + cardRot.y - ownerRotation.y, 45))
|
||||
|
||||
-- move the main card to threat area
|
||||
GlobalApi.moveCardWithTokens(hoveredObject, threatAreaPos, newCardRot)
|
||||
|
@ -2856,9 +2856,6 @@ function moveCardWithTokens(params)
|
||||
|
||||
if rotation then
|
||||
card.setRotation(rotation)
|
||||
else
|
||||
local rot = card.getRotation()
|
||||
card.setRotation(rot:setAt("y", roundToMultiple(rot.y, 45)))
|
||||
end
|
||||
|
||||
if position then
|
||||
@ -2964,7 +2961,3 @@ function removeTokensFromObject(params)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function roundToMultiple(num, mult)
|
||||
return math.floor((num + mult / 2) / mult) * mult
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user