mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'master' into FF/MasterDevel
This commit is contained in:
commit
f87126f22c
@ -3289,6 +3289,26 @@ function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex ) -- R2.2
|
|||||||
SpawnTemplate.units[UnitID].callsign = Callsign + SpawnIndex
|
SpawnTemplate.units[UnitID].callsign = Callsign + SpawnIndex
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- Link16
|
||||||
|
local AddProps = SpawnTemplate.units[UnitID].AddPropAircraft
|
||||||
|
if AddProps then
|
||||||
|
if SpawnTemplate.units[UnitID].AddPropAircraft.STN_L16 then
|
||||||
|
SpawnTemplate.units[UnitID].AddPropAircraft.STN_L16 = SpawnTemplate.units[UnitID].AddPropAircraft.STN_L16+UnitID-1
|
||||||
|
if SpawnTemplate.units[UnitID].AddPropAircraft.STN_L16 < 10000 then
|
||||||
|
SpawnTemplate.units[UnitID].AddPropAircraft.STN_L16 = string.format("0%d",SpawnTemplate.units[UnitID].AddPropAircraft.STN_L16)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- VoiceCallsignNumber
|
||||||
|
if SpawnTemplate.units[UnitID].AddPropAircraft.VoiceCallsignNumber then
|
||||||
|
SpawnTemplate.units[UnitID].AddPropAircraft.VoiceCallsignNumber = SpawnTemplate.units[UnitID].AddPropAircraft.VoiceCallsignNumber+UnitID-1
|
||||||
|
end
|
||||||
|
--UTILS.PrintTableToLog(SpawnTemplate.units[UnitID].AddPropAircraft,1)
|
||||||
|
-- FlightLead
|
||||||
|
if SpawnTemplate.units[UnitID].datalinks and SpawnTemplate.units[UnitID].datalinks.Link16 and SpawnTemplate.units[UnitID].datalinks.Link16.settings then
|
||||||
|
SpawnTemplate.units[UnitID].datalinks.Link16.settings.flightLead = UnitID == 1 and true or false
|
||||||
|
end
|
||||||
|
--UTILS.PrintTableToLog(SpawnTemplate.units[UnitID].datalinks,1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
self:T3( { "Template:", SpawnTemplate } )
|
self:T3( { "Template:", SpawnTemplate } )
|
||||||
|
|||||||
@ -20,6 +20,7 @@
|
|||||||
-- ### Author: FlightControl - Framework Design & Programming
|
-- ### Author: FlightControl - Framework Design & Programming
|
||||||
-- ### Refactoring to use the Runway auto-detection: Applevangelist
|
-- ### Refactoring to use the Runway auto-detection: Applevangelist
|
||||||
-- @date August 2022
|
-- @date August 2022
|
||||||
|
-- Last Update Nov 2023
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
@ -53,7 +54,7 @@ function ATC_GROUND:New( Airbases, AirbaseList )
|
|||||||
|
|
||||||
-- Inherits from BASE
|
-- Inherits from BASE
|
||||||
local self = BASE:Inherit( self, BASE:New() ) -- #ATC_GROUND
|
local self = BASE:Inherit( self, BASE:New() ) -- #ATC_GROUND
|
||||||
self:E( { self.ClassName, Airbases } )
|
self:T( { self.ClassName, Airbases } )
|
||||||
|
|
||||||
self.Airbases = Airbases
|
self.Airbases = Airbases
|
||||||
self.AirbaseList = AirbaseList
|
self.AirbaseList = AirbaseList
|
||||||
@ -260,7 +261,7 @@ function ATC_GROUND:_AirbaseMonitor()
|
|||||||
local IsOnGround = Client:InAir() == false
|
local IsOnGround = Client:InAir() == false
|
||||||
|
|
||||||
for AirbaseID, AirbaseMeta in pairs( self.Airbases ) do
|
for AirbaseID, AirbaseMeta in pairs( self.Airbases ) do
|
||||||
self:E( AirbaseID, AirbaseMeta.KickSpeed )
|
self:T( AirbaseID, AirbaseMeta.KickSpeed )
|
||||||
|
|
||||||
if AirbaseMeta.Monitor == true and Client:IsInZone( AirbaseMeta.ZoneBoundary ) then
|
if AirbaseMeta.Monitor == true and Client:IsInZone( AirbaseMeta.ZoneBoundary ) then
|
||||||
|
|
||||||
@ -273,7 +274,7 @@ function ATC_GROUND:_AirbaseMonitor()
|
|||||||
|
|
||||||
if IsOnGround then
|
if IsOnGround then
|
||||||
local Taxi = Client:GetState( self, "Taxi" )
|
local Taxi = Client:GetState( self, "Taxi" )
|
||||||
self:E( Taxi )
|
self:T( Taxi )
|
||||||
if Taxi == false then
|
if Taxi == false then
|
||||||
local Velocity = VELOCITY:New( AirbaseMeta.KickSpeed or self.KickSpeed )
|
local Velocity = VELOCITY:New( AirbaseMeta.KickSpeed or self.KickSpeed )
|
||||||
Client:Message( "Welcome to " .. AirbaseID .. ". The maximum taxiing speed is " ..
|
Client:Message( "Welcome to " .. AirbaseID .. ". The maximum taxiing speed is " ..
|
||||||
@ -439,7 +440,7 @@ function ATC_GROUND_UNIVERSAL:New(AirbaseList)
|
|||||||
|
|
||||||
-- Inherits from BASE
|
-- Inherits from BASE
|
||||||
local self = BASE:Inherit( self, BASE:New() ) -- #ATC_GROUND
|
local self = BASE:Inherit( self, BASE:New() ) -- #ATC_GROUND
|
||||||
self:E( { self.ClassName } )
|
self:T( { self.ClassName } )
|
||||||
|
|
||||||
self.Airbases = {}
|
self.Airbases = {}
|
||||||
|
|
||||||
@ -696,9 +697,9 @@ end
|
|||||||
-- @param #ATC_GROUND_UNIVERSAL self
|
-- @param #ATC_GROUND_UNIVERSAL self
|
||||||
-- @return #ATC_GROUND_UNIVERSAL self
|
-- @return #ATC_GROUND_UNIVERSAL self
|
||||||
function ATC_GROUND_UNIVERSAL:_AirbaseMonitor()
|
function ATC_GROUND_UNIVERSAL:_AirbaseMonitor()
|
||||||
|
self:I("_AirbaseMonitor")
|
||||||
self.SetClient:ForEachClient(
|
self.SetClient:ForEachClient(
|
||||||
-- @param Wrapper.Client#CLIENT Client
|
--- @param Wrapper.Client#CLIENT Client
|
||||||
function( Client )
|
function( Client )
|
||||||
|
|
||||||
if Client:IsAlive() then
|
if Client:IsAlive() then
|
||||||
@ -706,7 +707,7 @@ function ATC_GROUND_UNIVERSAL:_AirbaseMonitor()
|
|||||||
local IsOnGround = Client:InAir() == false
|
local IsOnGround = Client:InAir() == false
|
||||||
|
|
||||||
for AirbaseID, AirbaseMeta in pairs( self.Airbases ) do
|
for AirbaseID, AirbaseMeta in pairs( self.Airbases ) do
|
||||||
self:E( AirbaseID, AirbaseMeta.KickSpeed )
|
self:T( AirbaseID, AirbaseMeta.KickSpeed )
|
||||||
|
|
||||||
if AirbaseMeta.Monitor == true and Client:IsInZone( AirbaseMeta.ZoneBoundary ) then
|
if AirbaseMeta.Monitor == true and Client:IsInZone( AirbaseMeta.ZoneBoundary ) then
|
||||||
|
|
||||||
@ -723,7 +724,7 @@ function ATC_GROUND_UNIVERSAL:_AirbaseMonitor()
|
|||||||
|
|
||||||
if IsOnGround then
|
if IsOnGround then
|
||||||
local Taxi = Client:GetState( self, "Taxi" )
|
local Taxi = Client:GetState( self, "Taxi" )
|
||||||
self:E( Taxi )
|
self:T( Taxi )
|
||||||
if Taxi == false then
|
if Taxi == false then
|
||||||
local Velocity = VELOCITY:New( AirbaseMeta.KickSpeed or self.KickSpeed )
|
local Velocity = VELOCITY:New( AirbaseMeta.KickSpeed or self.KickSpeed )
|
||||||
Client:Message( "Welcome to " .. AirbaseID .. ". The maximum taxiing speed is " ..
|
Client:Message( "Welcome to " .. AirbaseID .. ". The maximum taxiing speed is " ..
|
||||||
@ -859,7 +860,7 @@ end
|
|||||||
-- @return #ATC_GROUND_UNIVERSAL self
|
-- @return #ATC_GROUND_UNIVERSAL self
|
||||||
function ATC_GROUND_UNIVERSAL:Start( RepeatScanSeconds )
|
function ATC_GROUND_UNIVERSAL:Start( RepeatScanSeconds )
|
||||||
RepeatScanSeconds = RepeatScanSeconds or 0.05
|
RepeatScanSeconds = RepeatScanSeconds or 0.05
|
||||||
self.AirbaseMonitor = SCHEDULER:New( self, self._AirbaseMonitor, { self }, 0, 2, RepeatScanSeconds )
|
self.AirbaseMonitor = SCHEDULER:New( self, self._AirbaseMonitor, { self }, 0, RepeatScanSeconds )
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -999,7 +1000,7 @@ end
|
|||||||
-- @return nothing
|
-- @return nothing
|
||||||
function ATC_GROUND_CAUCASUS:Start( RepeatScanSeconds )
|
function ATC_GROUND_CAUCASUS:Start( RepeatScanSeconds )
|
||||||
RepeatScanSeconds = RepeatScanSeconds or 0.05
|
RepeatScanSeconds = RepeatScanSeconds or 0.05
|
||||||
self.AirbaseMonitor = SCHEDULER:New( self, self._AirbaseMonitor, { self }, 0, 2, RepeatScanSeconds )
|
self.AirbaseMonitor = SCHEDULER:New( self, self._AirbaseMonitor, { self }, 0, RepeatScanSeconds )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -1138,7 +1139,7 @@ end
|
|||||||
-- @return nothing
|
-- @return nothing
|
||||||
function ATC_GROUND_NEVADA:Start( RepeatScanSeconds )
|
function ATC_GROUND_NEVADA:Start( RepeatScanSeconds )
|
||||||
RepeatScanSeconds = RepeatScanSeconds or 0.05
|
RepeatScanSeconds = RepeatScanSeconds or 0.05
|
||||||
self.AirbaseMonitor = SCHEDULER:New( self, self._AirbaseMonitor, { self }, 0, 2, RepeatScanSeconds )
|
self.AirbaseMonitor = SCHEDULER:New( self, self._AirbaseMonitor, { self }, 0, RepeatScanSeconds )
|
||||||
end
|
end
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -1295,7 +1296,7 @@ end
|
|||||||
-- @return nothing
|
-- @return nothing
|
||||||
function ATC_GROUND_NORMANDY:Start( RepeatScanSeconds )
|
function ATC_GROUND_NORMANDY:Start( RepeatScanSeconds )
|
||||||
RepeatScanSeconds = RepeatScanSeconds or 0.05
|
RepeatScanSeconds = RepeatScanSeconds or 0.05
|
||||||
self.AirbaseMonitor = SCHEDULER:New( self, self._AirbaseMonitor, { self }, 0, 2, RepeatScanSeconds )
|
self.AirbaseMonitor = SCHEDULER:New( self, self._AirbaseMonitor, { self }, 0, RepeatScanSeconds )
|
||||||
end
|
end
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -1438,7 +1439,7 @@ end
|
|||||||
-- @return nothing
|
-- @return nothing
|
||||||
function ATC_GROUND_PERSIANGULF:Start( RepeatScanSeconds )
|
function ATC_GROUND_PERSIANGULF:Start( RepeatScanSeconds )
|
||||||
RepeatScanSeconds = RepeatScanSeconds or 0.05
|
RepeatScanSeconds = RepeatScanSeconds or 0.05
|
||||||
self.AirbaseMonitor = SCHEDULER:New( self, self._AirbaseMonitor, { self }, 0, 2, RepeatScanSeconds )
|
self.AirbaseMonitor = SCHEDULER:New( self, self._AirbaseMonitor, { self }, 0, RepeatScanSeconds )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -1562,5 +1563,5 @@ end
|
|||||||
-- @return nothing
|
-- @return nothing
|
||||||
function ATC_GROUND_MARIANAISLANDS:Start( RepeatScanSeconds )
|
function ATC_GROUND_MARIANAISLANDS:Start( RepeatScanSeconds )
|
||||||
RepeatScanSeconds = RepeatScanSeconds or 0.05
|
RepeatScanSeconds = RepeatScanSeconds or 0.05
|
||||||
self.AirbaseMonitor = SCHEDULER:New( self, self._AirbaseMonitor, { self }, 0, 2, RepeatScanSeconds )
|
self.AirbaseMonitor = SCHEDULER:New( self, self._AirbaseMonitor, { self }, 0, RepeatScanSeconds )
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1397,6 +1397,10 @@ end
|
|||||||
-- atis:Start()
|
-- atis:Start()
|
||||||
function MSRS:LoadConfigFile(Path,Filename)
|
function MSRS:LoadConfigFile(Path,Filename)
|
||||||
|
|
||||||
|
if lfs == nil then
|
||||||
|
env.info("*****Note - lfs and os need to be desanitized for MSRS to work!")
|
||||||
|
return false
|
||||||
|
end
|
||||||
local path = Path or lfs.writedir()..MSRS.ConfigFilePath
|
local path = Path or lfs.writedir()..MSRS.ConfigFilePath
|
||||||
local file = Filename or MSRS.ConfigFileName or "Moose_MSRS.lua"
|
local file = Filename or MSRS.ConfigFileName or "Moose_MSRS.lua"
|
||||||
local pathandfile = path..file
|
local pathandfile = path..file
|
||||||
|
|||||||
@ -566,7 +566,7 @@ end
|
|||||||
-- @return #number Heading
|
-- @return #number Heading
|
||||||
function WEAPON:GetReleaseHeading(AccountForMagneticInclination)
|
function WEAPON:GetReleaseHeading(AccountForMagneticInclination)
|
||||||
AccountForMagneticInclination = AccountForMagneticInclination or true
|
AccountForMagneticInclination = AccountForMagneticInclination or true
|
||||||
if AccountForMagneticInclination then return self.releaseHeading - UTILS.GetMagneticDeclination() else return self.releaseHeading end
|
if AccountForMagneticInclination then return UTILS.ClampAngle(self.releaseHeading - UTILS.GetMagneticDeclination()) else return UTILS.ClampAngle(self.releaseHeading) end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get the altitude above sea level at which the weapon was released
|
--- Get the altitude above sea level at which the weapon was released
|
||||||
@ -603,7 +603,7 @@ end
|
|||||||
-- @return #number Heading
|
-- @return #number Heading
|
||||||
function WEAPON:GetImpactHeading(AccountForMagneticInclination)
|
function WEAPON:GetImpactHeading(AccountForMagneticInclination)
|
||||||
AccountForMagneticInclination = AccountForMagneticInclination or true
|
AccountForMagneticInclination = AccountForMagneticInclination or true
|
||||||
if AccountForMagneticInclination then return self.impactHeading - UTILS.GetMagneticDeclination() else return self.impactHeading end
|
if AccountForMagneticInclination then return UTILS.ClampAngle(self.impactHeading - UTILS.GetMagneticDeclination()) else return self.impactHeading end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Check if weapon is in the air. Obviously not really useful for torpedos. Well, then again, this is DCS...
|
--- Check if weapon is in the air. Obviously not really useful for torpedos. Well, then again, this is DCS...
|
||||||
@ -767,6 +767,9 @@ function WEAPON:_TrackWeapon(time)
|
|||||||
-- Update coordinate.
|
-- Update coordinate.
|
||||||
self.coordinate:UpdateFromVec3(self.vec3)
|
self.coordinate:UpdateFromVec3(self.vec3)
|
||||||
|
|
||||||
|
-- Safe the last velocity of the weapon. This is needed to get the impact heading
|
||||||
|
self.last_velocity = self.weapon:getVelocity()
|
||||||
|
|
||||||
-- Keep on tracking by returning the next time below.
|
-- Keep on tracking by returning the next time below.
|
||||||
self.tracking=true
|
self.tracking=true
|
||||||
|
|
||||||
@ -836,8 +839,8 @@ function WEAPON:_TrackWeapon(time)
|
|||||||
-- Safe impact coordinate.
|
-- Safe impact coordinate.
|
||||||
self.impactCoord=COORDINATE:NewFromVec3(self.vec3)
|
self.impactCoord=COORDINATE:NewFromVec3(self.vec3)
|
||||||
|
|
||||||
-- Safe impact heading
|
-- Safe impact heading, using last_velocity because self:GetVelocityVec3() is no longer possible
|
||||||
self.impactHeading = UTILS.VecHdg(self:GetVelocityVec3())
|
self.impactHeading = UTILS.VecHdg(self.last_velocity)
|
||||||
|
|
||||||
-- Mark impact point on F10 map.
|
-- Mark impact point on F10 map.
|
||||||
if self.impactMark then
|
if self.impactMark then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user