From 601805abb03681e15502b1b246bb876fa667fe1c Mon Sep 17 00:00:00 2001 From: FullGas1 <51051389+FullGas1@users.noreply.github.com> Date: Sat, 29 Mar 2025 23:06:27 +0100 Subject: [PATCH] debug --- CTLD.lua | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/CTLD.lua b/CTLD.lua index 7f9d0fd..78e7bb9 100644 --- a/CTLD.lua +++ b/CTLD.lua @@ -8192,14 +8192,11 @@ function ctld.eventHandler:onEvent(event) return end - local function processHumanPlayer(mistDBsHumansByName) + local function processHumanPlayer() ctld.logTrace("in the 'processHumanPlayer' function processHumanPlayer()- unitName = %s", ctld.p(unitName)) ctld.logTrace("in the 'processHumanPlayer' function processHumanPlayer()- mist.DBs.humansByName[unitName] = %s", ctld.p(mist.DBs.humansByName[unitName])) ctld.logTrace("in the 'processHumanPlayer' function processHumanPlayer()- mist.DBs.humansByName = %s", ctld.p(mist.DBs.humansByName)) - ctld.logTrace("in the 'processHumanPlayer' function processHumanPlayer()- mistDBsHumansByName[unitName] = %s", ctld.p(mistDBsHumansByName[unitName])) - ctld.logTrace("in the 'processHumanPlayer' function processHumanPlayer()- mistDBsHumansByName = %s", ctld.p(mistDBsHumansByName)) - --if mist.DBs.humansByName[unitName] then -- it's a human unit - if mistDBsHumansByName[unitName] then -- it's a human unit + if mist.DBs.humansByName[unitName] then -- it's a human unit ctld.logDebug("caught event %s for human unit [%s]", ctld.p(eventName), ctld.p(unitName)) local _unit = Unit.getByName(unitName) if _unit ~= nil then @@ -8238,13 +8235,13 @@ function ctld.eventHandler:onEvent(event) if not mist.DBs.humansByName[unitName] then -- give a few milliseconds for MiST to handle the BIRTH event too ctld.logTrace("give MiST some time to handle the BIRTH event too") - timer.scheduleFunction(function(mistDBsHumansByName, t) + timer.scheduleFunction(function() ctld.logTrace("calling the 'processHumanPlayer' function in a timer") - processHumanPlayer(mistDBsHumansByName) - end, {mist.DBs.humansByName}, timer.getTime() + 0.5) + processHumanPlayer() + end, nil, timer.getTime() + 1) else ctld.logTrace("calling the 'processHumanPlayer' function immediately") - processHumanPlayer(mist.DBs.humansByName) + processHumanPlayer() end end