From 644025df7a0fb679530b7f38da64660a83a4ca3f Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 3 Jan 2023 23:25:56 +0100 Subject: [PATCH] resolving comments --- src/core/token/TokenManager.ttslua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/core/token/TokenManager.ttslua b/src/core/token/TokenManager.ttslua index 42477a2a..7c18cada 100644 --- a/src/core/token/TokenManager.ttslua +++ b/src/core/token/TokenManager.ttslua @@ -165,11 +165,9 @@ do TokenManager.spawnCounterToken = function(card, tokenType, tokenValue, shiftDown) if tokenValue < 1 or tokenValue > 50 then return end - local pos = card.positionToWorld(card.positionToLocal(card.getPosition()) + Vector(0, 0.2, shiftDown)) + local pos = card.positionToWorld(Vector(0, 0.2, shiftDown)) local rot = card.getRotation() - TokenManager.spawnToken(pos, tokenType, rot, function(spawned) - spawned.setState(tokenValue) - end) + TokenManager.spawnToken(pos, tokenType, rot, function(spawned) spawned.setState(tokenValue) end) end -- Spawns a number of tokens. @@ -230,10 +228,16 @@ do local tokenTemplate = tokenTemplates[tokenType] -- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag + local rot = Vector(tokenTemplate.Transform.rotX, + 270, + tokenTemplate.Transform.rotZ) + if rotation ~= nil then + rot.y = rotation.y + end return spawnObjectData({ data = tokenTemplate, position = position, - rotation = Vector(tokenTemplate.Transform.rotX, rotation.y or 270, tokenTemplate.Transform.rotZ), + rotation = rot, callback_function = callback }) end