From 51607fa6f46b778b519b9684897cb4bf53b6ce84 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 3 Sep 2024 18:52:26 +0200 Subject: [PATCH] fixed mini card detection --- src/accessories/CleanUpHelper.ttslua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/accessories/CleanUpHelper.ttslua b/src/accessories/CleanUpHelper.ttslua index ff09033b..0d0ae94c 100644 --- a/src/accessories/CleanUpHelper.ttslua +++ b/src/accessories/CleanUpHelper.ttslua @@ -258,11 +258,12 @@ function returnMiniCards() end -- move mini cards - for _, mat in pairs(guidReferenceApi.getObjectsByType("Playermat")) do - local miniId = mat.getVar("activeInvestigatorId") .. "-m" + for _, matColor in ipairs(COLORS) do + local data = playermatApi.getActiveInvestigatorData(matColor) + local miniId = data.id .. "-m" if miniCardIndex[miniId] then - local pos = mat.positionToWorld(Vector(-1.36, 0, -0.625)):setAt("y", 1.67) - miniCardIndex[miniId].setPosition(pos) + local pos = playermatApi.transformLocalPosition(Vector(-1.36, 0, -0.625), matColor) + miniCardIndex[miniId].setPosition(pos:setAt("y", 1.67)) end end end