This commit is contained in:
FullGas1
2025-03-29 23:06:27 +01:00
parent e0e4279f20
commit 601805abb0
+6 -9
View File
@@ -8192,14 +8192,11 @@ function ctld.eventHandler:onEvent(event)
return return
end 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()- 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[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()- mist.DBs.humansByName = %s", ctld.p(mist.DBs.humansByName))
ctld.logTrace("in the 'processHumanPlayer' function processHumanPlayer()- mistDBsHumansByName[unitName] = %s", ctld.p(mistDBsHumansByName[unitName])) if mist.DBs.humansByName[unitName] then -- it's a human unit
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
ctld.logDebug("caught event %s for human unit [%s]", ctld.p(eventName), ctld.p(unitName)) ctld.logDebug("caught event %s for human unit [%s]", ctld.p(eventName), ctld.p(unitName))
local _unit = Unit.getByName(unitName) local _unit = Unit.getByName(unitName)
if _unit ~= nil then if _unit ~= nil then
@@ -8238,13 +8235,13 @@ function ctld.eventHandler:onEvent(event)
if not mist.DBs.humansByName[unitName] then if not mist.DBs.humansByName[unitName] then
-- give a few milliseconds for MiST to handle the BIRTH event too -- give a few milliseconds for MiST to handle the BIRTH event too
ctld.logTrace("give MiST some time 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") ctld.logTrace("calling the 'processHumanPlayer' function in a timer")
processHumanPlayer(mistDBsHumansByName) processHumanPlayer()
end, {mist.DBs.humansByName}, timer.getTime() + 0.5) end, nil, timer.getTime() + 1)
else else
ctld.logTrace("calling the 'processHumanPlayer' function immediately") ctld.logTrace("calling the 'processHumanPlayer' function immediately")
processHumanPlayer(mist.DBs.humansByName) processHumanPlayer()
end end
end end