Bugfix for getting investigator data

This commit is contained in:
Chr1Z93 2024-08-03 18:27:19 +02:00
parent c70de840f7
commit e786bef6e5
2 changed files with 17 additions and 7 deletions

View File

@ -245,9 +245,15 @@ do
if tokenType == "resource" and stateID ~= nil and stateID ~= 1 then
callback = function(spawned) spawned.setState(stateID) end
elseif tokenType == "universalActionAbility" then
local matColor = playermatApi.getMatColorByPosition(card.getPosition())
local class = playermatApi.returnInvestigatorClass(matColor)
callback = function(spawned) spawned.call("updateClassAndSymbol", { class = class, symbol = subType or class }) end
callback = function(spawned)
local matColor = playermatApi.getMatColorByPosition(card.getPosition())
local activeInvestigatorData = playermatApi.getActiveInvestigatorData(matColor)
spawned.call("updateClassAndSymbol", {
class = activeInvestigatorData.class,
symbol = subType or activeInvestigatorData.class
})
end
end
for i = 1, tokenCount do

View File

@ -66,12 +66,16 @@ function onScriptingButtonDown(index, playerColor)
-- check for nearest investigator card and change action token state to its class
elseif tokenType == "universalActionAbility" then
local matColor = playermatApi.getMatColorByPosition(position)
local matRotation = playermatApi.returnRotation(matColor)
local class = playermatApi.returnInvestigatorClass(matColor)
callback = function(spawned)
local matColor = playermatApi.getMatColorByPosition(position)
local matRotation = playermatApi.returnRotation(matColor)
local activeInvestigatorData = playermatApi.getActiveInvestigatorData(matColor)
spawned.setRotation(matRotation)
spawned.call("updateClassAndSymbol", { class = class, symbol = class })
spawned.call("updateClassAndSymbol", {
class = activeInvestigatorData.class,
symbol = activeInvestigatorData.class
})
end
end