resolving comments

This commit is contained in:
Chr1Z93 2023-01-03 23:25:56 +01:00
parent eac84f583d
commit 644025df7a

View File

@ -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