Skip to content

Commit

Permalink
#RECOVERYTANKER
Browse files Browse the repository at this point in the history
* Added option to set unlimited fuel
  • Loading branch information
Applevangelist committed Oct 21, 2023
1 parent 456c002 commit ab06867
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion Moose Development/Moose/Ops/RecoveryTanker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
-- @field #boolean eplrs If true, enable data link, e.g. if used as AWACS.
-- @field #boolean recovery If true, tanker will recover using the AIRBOSS marshal pattern.
-- @field #number terminaltype Terminal type of used parking spots on airbases.
-- @field #boolean unlimitedfuel If true, the tanker will have unlimited fuel.
-- @extends Core.Fsm#FSM

--- Recovery Tanker.
Expand Down Expand Up @@ -300,6 +301,7 @@ RECOVERYTANKER = {
eplrs = nil,
recovery = nil,
terminaltype = nil,
unlimitedfuel = false,
}

--- Unique ID (global).
Expand All @@ -308,7 +310,7 @@ _RECOVERYTANKERID=0

--- Class version.
-- @field #string version
RECOVERYTANKER.version="1.0.9"
RECOVERYTANKER.version="1.0.10"

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO list
Expand All @@ -326,6 +328,7 @@ RECOVERYTANKER.version="1.0.9"
-- DONE: Set AA TACAN.
-- DONE: Add refueling event/state.
-- DONE: Possibility to add already present/spawned aircraft, e.g. for warehouse.
-- DONE: Add unlimited fuel

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Constructor
Expand Down Expand Up @@ -550,6 +553,15 @@ end
-- User functions
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

--- Set the tanker to have unlimited fuel.
-- @param #RECOVERYTANKER self
-- @param #boolean OnOff If true, the tanker will have unlimited fuel.
-- @return #RECOVERYTANKER self
function RECOVERYTANKER:SetUnlimitedFuel(OnOff)
self.unlimitedfuel = OnOff
return self
end

--- Set the speed the tanker flys in its orbit pattern.
-- @param #RECOVERYTANKER self
-- @param #number speed True air speed (TAS) in knots. Default 274 knots, which results in ~250 KIAS.
Expand Down Expand Up @@ -899,6 +911,14 @@ function RECOVERYTANKER:onafterStart(From, Event, To)
-- Spawn tanker. We need to introduce an alias in case this class is used twice. This would confuse the spawn routine.
local Spawn=SPAWN:NewWithAlias(self.tankergroupname, self.alias)

if self.unlimitedfuel then
Spawn:OnSpawnGroup(
function (grp)
grp:CommandSetUnlimitedFuel(self.unlimitedfuel)
end
)
end

-- Set radio frequency and modulation.
Spawn:InitRadioCommsOnOff(true)
Spawn:InitRadioFrequency(self.RadioFreq)
Expand Down

0 comments on commit ab06867

Please sign in to comment.