#CSAR - Enforce pilot names on AI for saving

#SPAWN - Added use of CALLSIGN.Intruder for random callsigns of the A-6E
This commit is contained in:
Applevangelist
2025-12-29 12:35:03 +01:00
parent d000ad76f8
commit b31b11cda8
2 changed files with 12 additions and 2 deletions
+5
View File
@@ -3521,6 +3521,11 @@ function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex ) -- R2.2
max = 18 max = 18
ctable = CALLSIGN.F15E ctable = CALLSIGN.F15E
end end
if SpawnTemplate.units[1].type == "A6E" then
min = 4
max = 18
ctable = CALLSIGN.Intruder
end
local callsignnr = math.random(min,max) local callsignnr = math.random(min,max)
local callsignname = "Enfield" local callsignname = "Enfield"
for name, value in pairs(ctable) do for name, value in pairs(ctable) do
+6 -1
View File
@@ -318,7 +318,7 @@ CSAR.AircraftType["CH-47Fbl1"] = 31
--- CSAR class version. --- CSAR class version.
-- @field #string version -- @field #string version
CSAR.version="1.0.34" CSAR.version="1.0.35"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- ToDo list -- ToDo list
@@ -856,6 +856,10 @@ function CSAR:_AddCsar(_coalition , _country, _point, _typeName, _unitName, _pla
BeaconName = "Ghost-1-1"..math.random(1,10000) BeaconName = "Ghost-1-1"..math.random(1,10000)
end end
if _playerName == nil or _playerName == "" then
_playerName = "AI MIA"
end
if (_freq and _freq ~= 0) then --shagrat only add beacon if _freq is NOT 0 if (_freq and _freq ~= 0) then --shagrat only add beacon if _freq is NOT 0
self:_AddBeaconToGroup(_spawnedGroup, _freq, BeaconName) self:_AddBeaconToGroup(_spawnedGroup, _freq, BeaconName)
end end
@@ -2922,6 +2926,7 @@ function CSAR:onafterSave(From, Event, To, path, filename)
if DownedPilot and DownedPilot.alive then if DownedPilot and DownedPilot.alive then
-- get downed pilot data for saving -- get downed pilot data for saving
local playerName = DownedPilot.player local playerName = DownedPilot.player
if playerName == nil or playerName == "" then playerName = "AI MIA" end
local group = DownedPilot.group local group = DownedPilot.group
local coalition = group:GetCoalition() local coalition = group:GetCoalition()
local country = group:GetCountry() local country = group:GetCountry()