Merge pull request #291 from argonui/clue-hotkey

"Take a clue" hotkey: handling for stacked clues
This commit is contained in:
Tikatoy 2023-05-23 15:45:04 -07:00 committed by GitHub
commit 5906f91076
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,8 +108,13 @@ function takeClueFromLocation(playerColor, hoveredObject)
cardName = "nameless card" cardName = "nameless card"
end end
clue.setPositionSmooth(pos) -- check if found clue is a stack or single token
clue.setRotation(rot) if clue.getQuantity() > 1 then
clue.takeObject({position = pos, rotation = rot})
else
clue.setPositionSmooth(pos)
clue.setRotation(rot)
end
if cardName then if cardName then
broadcastToAll(playerName .. " took one clue from " .. cardName .. ".", playerColor) broadcastToAll(playerName .. " took one clue from " .. cardName .. ".", playerColor)
@ -138,4 +143,4 @@ function searchOnObj(obj)
size = obj.getBounds().size, size = obj.getBounds().size,
origin = obj.getPosition() origin = obj.getPosition()
}) })
end end