Merge pull request #203 from argonui/customdatahelper-bugfix

Custom Data Helper referring bugfix
This commit is contained in:
Chr1Z 2023-01-27 20:58:25 +01:00 committed by GitHub
commit 279b68d5d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View File

@ -160,7 +160,7 @@ end
-- main function
---------------------------------------------------------
function cleanUp()
function cleanUp(_, color)
printToAll("------------------------------", "White")
printToAll("Clean up started!", "Orange")
printToAll("Resetting counters...", "White")
@ -172,7 +172,7 @@ function cleanUp()
updateCounters(CLUE_CLICKER_GUIDS, 0, "Clue clickers")
resetSkillTrackers()
resetDoomCounter()
removeBlessCurse()
removeBlessCurse(color)
removeLines()
discardHands()
tokenSpawnTrackerApi.resetAll()
@ -232,8 +232,8 @@ end
-- gets the GUID of a custom data helper (if present) and adds it to the ignore list
function ignoreCustomDataHelper()
local playArea = getObjectFromGUID("721ba2")
local guid = playArea.getVar("customDataHelper")
if guid then table.insert(IGNORE_GUIDS, guid) end
local customDataHelper = playArea.getVar("customDataHelper")
if customDataHelper then table.insert(IGNORE_GUIDS, customDataHelper.getGUID()) end
end
-- read values for trauma from campaign log if enabled
@ -272,11 +272,11 @@ function getTrauma()
end
-- get rid of bless/curse tokens via bless/curse manager
function removeBlessCurse()
function removeBlessCurse(color)
local BlessCurseManager = getObjectFromGUID("5933fb")
if BlessCurseManager ~= nil then
BlessCurseManager.call("doRemove", "White")
BlessCurseManager.call("doRemove", color)
else
printToAll("Bless / Curse manager could not be found and thus bless/curse tokens were skipped.", "Yellow")
end

View File

@ -84,7 +84,10 @@ function updateSurface(newURL)
playArea.setCustomObject(customInfo)
-- get custom data helper and call the playarea with it after reloading
local guid = playArea.getVar("customDataHelper")
local customDataHelper = playArea.getVar("customDataHelper")
local guid
if customDataHelper then guid = customDataHelper.getGUID() end
playArea = playArea.reload()
if guid ~= nil then