From c17587771ffdcbf13b8ab3e9d05266635a09a51e Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 3 Oct 2023 10:46:48 +0200 Subject: [PATCH] bugfix for clue counts > 12 --- src/core/token/TokenManager.ttslua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/token/TokenManager.ttslua b/src/core/token/TokenManager.ttslua index 3687ee64..cee5204d 100644 --- a/src/core/token/TokenManager.ttslua +++ b/src/core/token/TokenManager.ttslua @@ -204,14 +204,15 @@ do ---@param shiftDown Number An offset for the z-value of this group of tokens ---@param subType Number Subtype of token to spawn. This will only differ from the tokenName for resource tokens TokenManager.spawnMultipleTokens = function(card, tokenType, tokenCount, shiftDown, subType) - if tokenCount < 1 or tokenCount > 12 then - return - end + -- not checking the max at this point since clue offsets are calculated dynamically + if tokenCount < 1 then return end local offsets = {} if tokenType == "clue" then offsets = internal.buildClueOffsets(card, tokenCount) else + -- only up to 12 offset tables defined + if tokenCount > 12 then return end for i = 1, tokenCount do offsets[i] = card.positionToWorld(PLAYER_CARD_TOKEN_OFFSETS[tokenCount][i]) -- Fix the y-position for the spawn, since positionToWorld considers rotation which can @@ -479,7 +480,6 @@ do local column = (i - 1) % 4 table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column)) end - return cluePositions end