From 189f08cce39222ee8c0550301f503fd09b6bc50a Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 16 May 2023 10:13:13 +0200 Subject: [PATCH] handling for stacked clues --- src/core/GameKeyHandler.ttslua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/core/GameKeyHandler.ttslua b/src/core/GameKeyHandler.ttslua index 1c39f496..daaa243c 100644 --- a/src/core/GameKeyHandler.ttslua +++ b/src/core/GameKeyHandler.ttslua @@ -108,8 +108,13 @@ function takeClueFromLocation(playerColor, hoveredObject) cardName = "nameless card" end - clue.setPositionSmooth(pos) - clue.setRotation(rot) + -- check if found clue is a stack or single token + if clue.getQuantity() > 1 then + clue.takeObject({position = pos, rotation = rot}) + else + clue.setPositionSmooth(pos) + clue.setRotation(rot) + end if cardName then broadcastToAll(playerName .. " took one clue from " .. cardName .. ".", playerColor) @@ -138,4 +143,4 @@ function searchOnObj(obj) size = obj.getBounds().size, origin = obj.getPosition() }) -end \ No newline at end of file +end