mirror of
https://github.com/ciribob/DCS-CTLD.git
synced 2026-08-19 22:17:10 +00:00
debug
This commit is contained in:
@@ -8210,7 +8210,7 @@ function ctld.eventHandler:onEvent(event)
|
|||||||
if ctld.addPlayerAircraftByType then
|
if ctld.addPlayerAircraftByType then
|
||||||
for _, aircraftType in pairs(ctld.aircraftTypeTable) do
|
for _, aircraftType in pairs(ctld.aircraftTypeTable) do
|
||||||
ctld.logTrace("FG_ XXXXXXXXXXXXXXXXXXX aircraftType == playerTypeName XXXXXXXXXXXXXXXXXXXXXXXX %s - %s", ctld.p(aircraftType), ctld.p(playerTypeName))
|
ctld.logTrace("FG_ XXXXXXXXXXXXXXXXXXX aircraftType == playerTypeName XXXXXXXXXXXXXXXXXXXXXXXX %s - %s", ctld.p(aircraftType), ctld.p(playerTypeName))
|
||||||
if aircraftType == playerTypeName then
|
if aircraftType == playerTypeName and ctld.isValueInIpairTable(ctld.transportPilotNames, unitName) == false then
|
||||||
ctld.logTrace("adding by aircraft type, unitName = %s", ctld.p(unitName))
|
ctld.logTrace("adding by aircraft type, unitName = %s", ctld.p(unitName))
|
||||||
-- add transport unit to the list
|
-- add transport unit to the list
|
||||||
table.insert(ctld.transportPilotNames, unitName)
|
table.insert(ctld.transportPilotNames, unitName)
|
||||||
@@ -8238,7 +8238,7 @@ function ctld.eventHandler:onEvent(event)
|
|||||||
timer.scheduleFunction(function()
|
timer.scheduleFunction(function()
|
||||||
ctld.logTrace("calling the 'processHumanPlayer' function in a timer")
|
ctld.logTrace("calling the 'processHumanPlayer' function in a timer")
|
||||||
processHumanPlayer()
|
processHumanPlayer()
|
||||||
end, nil, timer.getTime() + 1)
|
end, nil, timer.getTime() + 1.5)
|
||||||
else
|
else
|
||||||
ctld.logTrace("calling the 'processHumanPlayer' function immediately")
|
ctld.logTrace("calling the 'processHumanPlayer' function immediately")
|
||||||
processHumanPlayer()
|
processHumanPlayer()
|
||||||
@@ -8287,6 +8287,16 @@ function ctld.RandomReal(mini, maxi)
|
|||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Tools
|
||||||
|
function ctld.isValueInIpairTable(tab, value)
|
||||||
|
for i, v in ipairs(tab) do
|
||||||
|
if v == value then
|
||||||
|
return true -- La valeur existe
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false -- La valeur n'existe pas
|
||||||
|
end
|
||||||
|
|
||||||
--- Enable/Disable error boxes displayed on screen.
|
--- Enable/Disable error boxes displayed on screen.
|
||||||
env.setErrorMessageBoxEnabled(false)
|
env.setErrorMessageBoxEnabled(false)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user