added additional check

This commit is contained in:
Chr1Z93 2023-06-13 09:45:05 +02:00
parent 6baee451da
commit 9d126215ba

View File

@ -107,6 +107,14 @@ do
}
}
-- stateIDs for the multi-stated resource tokens
local stateTable = {
["Ammo"] = 2,
["Charge"] = 3,
["Secret"] = 4,
["Supply"] = 5
}
-- Source for tokens
local TOKEN_SOURCE_GUID = "124381"
@ -223,7 +231,7 @@ do
-- this is used to load the correct state for additional resource tokens (e.g. "Ammo")
local callback = nil
if stateID ~= nil then
if tokenType == "resource" and stateID ~= nil then
callback = function(spawned) spawned.setState(stateID) end
end
@ -335,14 +343,6 @@ do
local uses = internal.getUses(card)
if uses == nil then return end
-- get the stateID for the additional resource tokens
local stateTable = {
["Ammo"] = 2,
["Charge"] = 3,
["Secret"] = 4,
["Supply"] = 5
}
-- go through tokens to spawn
local type, token, tokenCount
for i, useInfo in ipairs(uses) do