mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
50ff9f162a
@ -3815,18 +3815,9 @@ function FLIGHTGROUP:_InitGroup(Template)
|
|||||||
-- Group object.
|
-- Group object.
|
||||||
local group=self.group --Wrapper.Group#GROUP
|
local group=self.group --Wrapper.Group#GROUP
|
||||||
|
|
||||||
-- Get template of group.
|
|
||||||
local template=Template or self:_GetTemplate()
|
|
||||||
|
|
||||||
-- Helo group.
|
-- Helo group.
|
||||||
self.isHelo=group:IsHelicopter()
|
self.isHelo=group:IsHelicopter()
|
||||||
|
|
||||||
-- Is (template) group uncontrolled.
|
|
||||||
self.isUncontrolled=template.uncontrolled
|
|
||||||
|
|
||||||
-- Is (template) group late activated.
|
|
||||||
self.isLateActivated=template.lateActivation
|
|
||||||
|
|
||||||
-- Max speed in km/h.
|
-- Max speed in km/h.
|
||||||
self.speedMax=group:GetSpeedMax()
|
self.speedMax=group:GetSpeedMax()
|
||||||
|
|
||||||
@ -3847,6 +3838,17 @@ function FLIGHTGROUP:_InitGroup(Template)
|
|||||||
-- Group ammo.
|
-- Group ammo.
|
||||||
self.ammo=self:GetAmmoTot()
|
self.ammo=self:GetAmmoTot()
|
||||||
|
|
||||||
|
-- Get template of group.
|
||||||
|
local template=Template or self:_GetTemplate()
|
||||||
|
|
||||||
|
-- Is (template) group uncontrolled.
|
||||||
|
self.isUncontrolled=template~=nil and template.uncontrolled or false
|
||||||
|
|
||||||
|
-- Is (template) group late activated.
|
||||||
|
self.isLateActivated=template~=nil and template.lateActivation or false
|
||||||
|
|
||||||
|
if template then
|
||||||
|
|
||||||
-- Radio parameters from template. Default is set on spawn if not modified by user.
|
-- Radio parameters from template. Default is set on spawn if not modified by user.
|
||||||
self.radio.Freq=tonumber(template.frequency)
|
self.radio.Freq=tonumber(template.frequency)
|
||||||
self.radio.Modu=tonumber(template.modulation)
|
self.radio.Modu=tonumber(template.modulation)
|
||||||
@ -3866,6 +3868,8 @@ function FLIGHTGROUP:_InitGroup(Template)
|
|||||||
self.callsign.NumberGroup=tonumber(callsign[2])
|
self.callsign.NumberGroup=tonumber(callsign[2])
|
||||||
self.callsign.NameSquad=UTILS.GetCallsignName(self.callsign.NumberSquad)
|
self.callsign.NameSquad=UTILS.GetCallsignName(self.callsign.NumberSquad)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
-- Set default formation.
|
-- Set default formation.
|
||||||
if self.isHelo then
|
if self.isHelo then
|
||||||
self.optionDefault.Formation=ENUMS.Formation.RotaryWing.EchelonLeft.D300
|
self.optionDefault.Formation=ENUMS.Formation.RotaryWing.EchelonLeft.D300
|
||||||
|
|||||||
@ -11372,11 +11372,19 @@ end
|
|||||||
-- @return #OPSGROUP self
|
-- @return #OPSGROUP self
|
||||||
function OPSGROUP:_InitWaypoints(WpIndexMin, WpIndexMax)
|
function OPSGROUP:_InitWaypoints(WpIndexMin, WpIndexMax)
|
||||||
|
|
||||||
-- Template waypoints.
|
|
||||||
self.waypoints0=UTILS.DeepCopy(_DATABASE:GetGroupTemplate(self.groupname).route.points) --self.group:GetTemplateRoutePoints()
|
|
||||||
|
|
||||||
-- Waypoints empty!
|
-- Waypoints empty!
|
||||||
self.waypoints={}
|
self.waypoints={}
|
||||||
|
self.waypoints0={}
|
||||||
|
|
||||||
|
-- Get group template
|
||||||
|
local template=_DATABASE:GetGroupTemplate(self.groupname)
|
||||||
|
|
||||||
|
if template==nil then
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Template waypoints.
|
||||||
|
self.waypoints0=UTILS.DeepCopy(template.route.points) --self.group:GetTemplateRoutePoints()
|
||||||
|
|
||||||
WpIndexMin=WpIndexMin or 1
|
WpIndexMin=WpIndexMin or 1
|
||||||
WpIndexMax=WpIndexMax or #self.waypoints0
|
WpIndexMax=WpIndexMax or #self.waypoints0
|
||||||
@ -13632,10 +13640,6 @@ function OPSGROUP:_AddElementByName(unitname)
|
|||||||
|
|
||||||
if unit then
|
if unit then
|
||||||
|
|
||||||
-- Get unit template.
|
|
||||||
local unittemplate=unit:GetTemplate()
|
|
||||||
--local unittemplate=_DATABASE:GetUnitTemplateFromUnitName(unitname)
|
|
||||||
|
|
||||||
-- Element table.
|
-- Element table.
|
||||||
local element=self:GetElementByName(unitname)
|
local element=self:GetElementByName(unitname)
|
||||||
|
|
||||||
@ -13662,8 +13666,18 @@ function OPSGROUP:_AddElementByName(unitname)
|
|||||||
element.Nhit=0
|
element.Nhit=0
|
||||||
element.opsgroup=self
|
element.opsgroup=self
|
||||||
|
|
||||||
|
-- Get unit template.
|
||||||
|
local unittemplate=unit:GetTemplate()
|
||||||
|
|
||||||
|
if unittemplate==nil then
|
||||||
|
if element.DCSunit:getPlayerName() then
|
||||||
|
element.skill="Client"
|
||||||
|
end
|
||||||
|
else
|
||||||
|
element.skill=unittemplate~=nil and unittemplate.skill or "Unknown"
|
||||||
|
end
|
||||||
|
|
||||||
-- Skill etc.
|
-- Skill etc.
|
||||||
element.skill=unittemplate.skill or "Unknown"
|
|
||||||
if element.skill=="Client" or element.skill=="Player" then
|
if element.skill=="Client" or element.skill=="Player" then
|
||||||
element.ai=false
|
element.ai=false
|
||||||
element.client=CLIENT:FindByName(unitname)
|
element.client=CLIENT:FindByName(unitname)
|
||||||
@ -13724,22 +13738,20 @@ function OPSGROUP:_AddElementByName(unitname)
|
|||||||
element.weight=element.weightEmpty+element.weightCargo
|
element.weight=element.weightEmpty+element.weightCargo
|
||||||
|
|
||||||
-- FLIGHTGROUP specific.
|
-- FLIGHTGROUP specific.
|
||||||
if self.isFlightgroup then
|
|
||||||
element.callsign=element.unit:GetCallsign()
|
element.callsign=element.unit:GetCallsign()
|
||||||
|
element.fuelmass=element.fuelmass0 or 99999
|
||||||
|
element.fuelrel=element.unit:GetFuel() or 1
|
||||||
|
|
||||||
|
if self.isFlightgroup and unittemplate then
|
||||||
element.modex=unittemplate.onboard_num
|
element.modex=unittemplate.onboard_num
|
||||||
element.payload=unittemplate.payload
|
element.payload=unittemplate.payload
|
||||||
element.pylons=unittemplate.payload and unittemplate.payload.pylons or nil
|
element.pylons=unittemplate.payload and unittemplate.payload.pylons or nil
|
||||||
element.fuelmass0=unittemplate.payload and unittemplate.payload.fuel or 0
|
element.fuelmass0=unittemplate.payload and unittemplate.payload.fuel or 0
|
||||||
element.fuelmass=element.fuelmass0
|
|
||||||
element.fuelrel=element.unit:GetFuel()
|
|
||||||
else
|
else
|
||||||
element.callsign="Peter-1-1"
|
element.callsign="Peter-1-1"
|
||||||
element.modex="000"
|
element.modex="000"
|
||||||
element.payload={}
|
element.payload={}
|
||||||
element.pylons={}
|
element.pylons={}
|
||||||
element.fuelmass0=99999
|
|
||||||
element.fuelmass =99999
|
|
||||||
element.fuelrel=1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Debug text.
|
-- Debug text.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user