Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Applevangelist committed Aug 20, 2024
2 parents 0496571 + 504142c commit b1a4040
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
23 changes: 14 additions & 9 deletions Moose Development/Moose/Ops/CSAR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
-- @image OPS_CSAR.jpg

---
-- Last Update July 2024
-- Last Update Aug 2024

-------------------------------------------------------------------------
--- **CSAR** class, extends Core.Base#BASE, Core.Fsm#FSM
Expand Down Expand Up @@ -136,6 +136,7 @@
-- mycsar.csarUsePara = false -- If set to true, will use the LandingAfterEjection Event instead of Ejection. Requires mycsar.enableForAI to be set to true. --shagrat
-- mycsar.wetfeettemplate = "man in floating thingy" -- if you use a mod to have a pilot in a rescue float, put the template name in here for wet feet spawns. Note: in conjunction with csarUsePara this might create dual ejected pilots in edge cases.
-- mycsar.allowbronco = false -- set to true to use the Bronco mod as a CSAR plane
-- mycsar.CreateRadioBeacons = true -- set to false to disallow creating ADF radio beacons.
--
-- ## 3. Results
--
Expand Down Expand Up @@ -256,6 +257,7 @@ CSAR = {
topmenuname = "CSAR",
ADFRadioPwr = 1000,
PilotWeight = 80,
CreateRadioBeacons = true,
}

--- Downed pilots info.
Expand Down Expand Up @@ -297,7 +299,7 @@ CSAR.AircraftType["CH-47Fbl1"] = 31

--- CSAR class version.
-- @field #string version
CSAR.version="1.0.26"
CSAR.version="1.0.27"

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- ToDo list
Expand Down Expand Up @@ -1855,11 +1857,11 @@ function CSAR:_DisplayActiveSAR(_unitName)
else
distancetext = string.format("%.1fkm", _distance/1000.0)
end
if _value.frequency == 0 then--shagrat insert CASEVAC without Frequency
table.insert(_csarList, { dist = _distance, msg = string.format("%s at %s - %s ", _value.desc, _coordinatesText, distancetext) })
else
table.insert(_csarList, { dist = _distance, msg = string.format("%s at %s - %.2f KHz ADF - %s ", _value.desc, _coordinatesText, _value.frequency / 1000, distancetext) })
end
if _value.frequency == 0 or self.CreateRadioBeacons == false then--shagrat insert CASEVAC without Frequency
table.insert(_csarList, { dist = _distance, msg = string.format("%s at %s - %s ", _value.desc, _coordinatesText, distancetext) })
else
table.insert(_csarList, { dist = _distance, msg = string.format("%s at %s - %.2f KHz ADF - %s ", _value.desc, _coordinatesText, _value.frequency / 1000, distancetext) })
end
end
end

Expand Down Expand Up @@ -2230,8 +2232,10 @@ end
-- @param #CSAR self
-- @param Wrapper.Group#GROUP _group Group #GROUP object.
-- @param #number _freq Frequency to use
-- @return #CSAR self
function CSAR:_AddBeaconToGroup(_group, _freq)
self:T(self.lid .. " _AddBeaconToGroup")
if self.CreateRadioBeacons == false then return end
local _group = _group
if _group == nil then
--return frequency to pool of available
Expand All @@ -2247,7 +2251,7 @@ function CSAR:_AddBeaconToGroup(_group, _freq)
if _group:IsAlive() then
local _radioUnit = _group:GetUnit(1)
if _radioUnit then
local name = _radioUnit:GetName()
local name = _radioUnit:GetName()
local Frequency = _freq -- Freq in Hertz
local name = _radioUnit:GetName()
local Sound = "l10n/DEFAULT/"..self.radioSound
Expand All @@ -2260,9 +2264,10 @@ end

--- (Internal) Helper function to (re-)add beacon to downed pilot.
-- @param #CSAR self
-- @param #table _args Arguments
-- @return #CSAR self
function CSAR:_RefreshRadioBeacons()
self:T(self.lid .. " _RefreshRadioBeacons")
if self.CreateRadioBeacons == false then return end
if self:_CountActiveDownedPilots() > 0 then
local PilotTable = self.downedPilots
for _,_pilot in pairs (PilotTable) do
Expand Down
10 changes: 7 additions & 3 deletions Moose Development/Moose/Ops/CTLD.lua
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,8 @@ do
-- my_ctld.RadioSound = "beacon.ogg" -- -- this sound will be hearable if you tune in the beacon frequency. Add the sound file to your miz.
-- my_ctld.RadioSoundFC3 = "beacon.ogg" -- this sound will be hearable by FC3 users (actually all UHF radios); change to something like "beaconsilent.ogg" and add the sound file to your miz if you don't want to annoy FC3 pilots.
-- my_ctld.enableChinookGCLoading = true -- this will effectively suppress the crate load and drop for CTLD_CARGO.Enum.STATIc types for CTLD for the Chinook
-- my_ctld.TroopUnloadDistGround = 1.5 -- If hovering, spawn dropped troops this far away from the helo
-- my_ctld.TroopUnloadDistHover = 5 -- If grounded, spawn dropped troops this far away from the helo
--
-- ## 2.1 CH-47 Chinook support
--
Expand Down Expand Up @@ -1208,6 +1210,8 @@ CTLD = {
pickupZones = {},
DynamicCargo = {},
ChinookTroopCircleRadius = 5,
TroopUnloadDistGround = 1.5,
TroopUnloadDistHover = 5,
}

------------------------------
Expand Down Expand Up @@ -2935,8 +2939,8 @@ function CTLD:_FindCratesNearby( _group, _unit, _dist, _ignoreweight)
local agl = staticpos.y-landheight
agl = UTILS.Round(agl,2)
local GCloaded = agl > 0 and true or false
if IsNoHook == true then GCloaded = false end
--]]
if IsNoHook == true then GCloaded = false end
--]]
--- Testing
local distance = self:_GetDistance(location,staticpos)
--self:T({name=static:GetName(),IsHook=IsHook,agl=agl,GCloaded=GCloaded,distance=string.format("%.2f",distance or 0)})
Expand Down Expand Up @@ -3432,7 +3436,7 @@ function CTLD:_UnloadTroops(Group, Unit)
randomcoord = Group:GetCoordinate()
-- slightly left from us
local Angle = (heading+270)%360
local offset = hoverunload and 1.5 or 5
local offset = hoverunload and self.TroopUnloadDistGround or self.TroopUnloadDistHover
randomcoord:Translate(offset,Angle,nil,true)
end
local tempcount = 0
Expand Down

0 comments on commit b1a4040

Please sign in to comment.