diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index 8bb6ac04..8d9fe461 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -2856,6 +2856,9 @@ 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 @@ -2961,3 +2964,7 @@ function removeTokensFromObject(params) end end end + +function roundToMultiple(num, mult) + return math.floor((num + mult / 2) / mult) * mult +end