Merge remote-tracking branch 'origin/master' into develop

# Conflicts:
#	Moose Development/Moose/Sound/SRS.lua
This commit is contained in:
Applevangelist 2023-11-24 08:58:23 +01:00
commit 7978bbc612
3 changed files with 13 additions and 11 deletions

View File

@ -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
-- --
-- === -- ===
-- --

View File

@ -1216,12 +1216,10 @@ end
-- --Start ATIS -- --Start ATIS
-- atis:Start() -- atis:Start()
function MSRS:LoadConfigFile(Path,Filename) function MSRS:LoadConfigFile(Path,Filename)
if not lfs then
env.info("MSRS - Config load, lfs is not available!",false) if lfs == nil then
return env.info("*****Note - lfs and os need to be desanitized for MSRS to work!")
end return false
if not os then
env.info("MSRS - Config load, os is not available!",false)
end 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"

View 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