From 338da36748fa2d2bfbfe5bf5a85a399e7ef6ecf4 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Thu, 21 Nov 2024 00:30:47 +0100 Subject: [PATCH] flip stop --- src/core/Global.ttslua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index 2bf26eac..90fe6246 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -186,6 +186,12 @@ function onObjectDrop(_, object) end end +function onObjectRotate(object, _, flip, _, _, oldFlip) + if flip ~= oldFlip then + stopTokenTransformUpdating(object) + end +end + -- Event hook for any object search. When chaos tokens are manipulated while the chaos bag -- container is being searched, a TTS bug can cause tokens to duplicate or vanish. We lock the -- chaos bag during search operations to avoid this. @@ -2917,6 +2923,7 @@ function updateTokenTransform(card) end function stopTokenTransformUpdating(card) + if cardTokens[card] == nil then return end for _, tokenData in ipairs(cardTokens[card] or {}) do if tokenData.token ~= nil then tokenData.token.locked = false