Update GameKeyHandler.ttslua

Reversed order of performDiscard's arguments
This commit is contained in:
Whimsical-Cloudheart 2024-05-28 08:39:40 -03:00 committed by GitHub
parent 377b436feb
commit f6bff32b14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -138,14 +138,14 @@ function discardObject(playerColor, hoveredObject)
-- These should probably not be discarded normally. Ask player for confirmation.
if (hoveredObject.type == "Deck") or hoveredObject.hasTag("Location") then
local suspect = (hoveredObject.type == "Deck") and "Deck" or "Location"
Player[playerColor].showConfirmDialog("Discard " .. suspect .. "?", function () performDiscard(hoveredObject, playerColor) end)
Player[playerColor].showConfirmDialog("Discard " .. suspect .. "?", function () performDiscard(playerColor, hoveredObject) end)
return
end
performDiscard(hoveredObject, playerColor)
performDiscard(playerColor, hoveredObject)
end
function performDiscard(hoveredObject, playerColor)
function performDiscard(playerColor, hoveredObject)
-- initialize list of objects to discard
local discardTheseObjects = { hoveredObject }
@ -174,7 +174,7 @@ function discardTopDeck(playerColor, hoveredObject)
else
takenCard = hoveredObject
end
Wait.frames(function() performDiscard(takenCard, playerColor) end, 1)
Wait.frames(function() performDiscard(playerColor, hoveredObject) end, 1)
end
-- helper function to get the player to trigger the discard function for