fixed a local, made code even smaller

This commit is contained in:
Zerino 2024-11-13 21:42:27 -03:00
parent 52e5ec01f4
commit 77f320e188
2 changed files with 5 additions and 8 deletions

View File

@ -38,13 +38,9 @@ function triggerUpkeep(playerColor)
sentMessage = true
end
if #Player.getPlayers() == 1 then
local colors = Player.getAvailableColors()
for _, handColor in ipairs(colors) do
local matColor = playermatApi.getMatColor(handColor)
local data = playermatApi.getActiveInvestigatorData(matColor)
if data.id ~= "00000" then
playermatApi.doUpkeepFromHotkey(matColor, playerColor)
end
local usedMats = playermatApi.getUsedMatColors()
for _, matColor in ipairs(usedMats) do
playermatApi.doUpkeepFromHotkey(matColor, playerColor)
end
playAreaApi.readyCards()
return

View File

@ -514,8 +514,9 @@ end
-- Readies all cards in the main playarea (both player cards, treacheries and enemies)
function readyCards(player, clickType)
local playerColor
if player ~= nil then
local playerColor = player.color
playerColor = player.color
else
local existingPlayer = Player.getPlayers()[1]
playerColor = existingPlayer.color