mirror of
https://github.com/ciribob/DCS-CTLD.git
synced 2025-08-15 06:17:22 +00:00
corrected a bug: the units listed in the ctld.transportPilotNames didn't have a F10 menu
This commit is contained in:
44
CTLD.lua
44
CTLD.lua
@@ -7212,35 +7212,23 @@ function ctld.eventHandler:onEvent(event)
|
|||||||
local playerTypeName = _unit:getTypeName()
|
local playerTypeName = _unit:getTypeName()
|
||||||
ctld.logTrace("playerTypeName = %s", ctld.p(playerTypeName))
|
ctld.logTrace("playerTypeName = %s", ctld.p(playerTypeName))
|
||||||
|
|
||||||
local notFound = true
|
-- Allow units to CTLD by aircraft type and not by pilot name
|
||||||
|
if ctld.addPlayerAircraftByType then
|
||||||
for _,transportPilotName in pairs(ctld.transportPilotNames) do
|
for _,aircraftType in pairs(ctld.aircraftTypeTable) do
|
||||||
if transportPilotName == unitName then
|
if aircraftType == playerTypeName then
|
||||||
ctld.logDebug("Unit is already a transport pilot, skipping...")
|
-- add transport unit to the list
|
||||||
notFound = false
|
table.insert(ctld.transportPilotNames, unitName)
|
||||||
break
|
-- add transport radio menu
|
||||||
end
|
ctld.addTransportF10MenuOptions(unitName)
|
||||||
end
|
break
|
||||||
|
|
||||||
if notFound then
|
|
||||||
-- Allow units to CTLD by aircraft type and not by pilot name
|
|
||||||
if ctld.addPlayerAircraftByType then
|
|
||||||
for _,aircraftType in pairs(ctld.aircraftTypeTable) do
|
|
||||||
if aircraftType == playerTypeName then
|
|
||||||
-- add transport unit to the list
|
|
||||||
table.insert(ctld.transportPilotNames, unitName)
|
|
||||||
-- add transport radio menu
|
|
||||||
ctld.addTransportF10MenuOptions(unitName)
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
else
|
end
|
||||||
for _, _unitName in pairs(ctld.transportPilotNames) do
|
else
|
||||||
if _unitName == unitName then
|
for _, _unitName in pairs(ctld.transportPilotNames) do
|
||||||
-- add transport radio menu
|
if _unitName == unitName then
|
||||||
ctld.addTransportF10MenuOptions(unitName)
|
-- add transport radio menu
|
||||||
break
|
ctld.addTransportF10MenuOptions(unitName)
|
||||||
end
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user