From 50298e4109f193af357ed40a45110347b7f08501 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Fri, 22 Mar 2024 08:56:00 +0100 Subject: [PATCH 1/3] Fix for unknown Threat Type --- Moose Development/Moose/Functional/Scoring.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Functional/Scoring.lua b/Moose Development/Moose/Functional/Scoring.lua index 15d23ba84..42dc8005a 100644 --- a/Moose Development/Moose/Functional/Scoring.lua +++ b/Moose Development/Moose/Functional/Scoring.lua @@ -229,7 +229,7 @@ SCORING = { ClassID = 0, Players = {}, AutoSave = true, - version = "1.18.2" + version = "1.18.3" } local _SCORINGCoalition = { @@ -1062,7 +1062,7 @@ function SCORING:_EventOnHit( Event ) if PlayerHit.UNIT.ThreatType == nil then PlayerHit.ThreatLevel, PlayerHit.ThreatType = PlayerHit.UNIT:GetThreatLevel() -- if this fails for some reason, set a good default value - if PlayerHit.ThreatType == nil then + if PlayerHit.ThreatType == nil or PlayerHit.ThreatType == "" then PlayerHit.ThreatLevel = 1 PlayerHit.ThreatType = "Unknown" end From 613d33d731e0340fccb94baca68d44caaf87ab65 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sat, 23 Mar 2024 14:58:54 +0100 Subject: [PATCH 2/3] #SCORING - added option to give a file path for saving and an option to switch autosave off --- Moose Development/Moose/Functional/Scoring.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Moose Development/Moose/Functional/Scoring.lua b/Moose Development/Moose/Functional/Scoring.lua index 42dc8005a..c4a0c8e20 100644 --- a/Moose Development/Moose/Functional/Scoring.lua +++ b/Moose Development/Moose/Functional/Scoring.lua @@ -229,7 +229,7 @@ SCORING = { ClassID = 0, Players = {}, AutoSave = true, - version = "1.18.3" + version = "1.18.4" } local _SCORINGCoalition = { @@ -248,13 +248,15 @@ local _SCORINGCategory = { --- Creates a new SCORING object to administer the scoring achieved by players. -- @param #SCORING self -- @param #string GameName The name of the game. This name is also logged in the CSV score file. +-- @param #string SavePath (Optional) Path where to save the CSV file, defaults to your **\\Saved Games\\DCS\\Logs** folder. +-- @param #boolean AutoSave (Optional) If passed as `false`, then swith autosave off. -- @return #SCORING self -- @usage -- -- -- Define a new scoring object for the mission Gori Valley. -- ScoringObject = SCORING:New( "Gori Valley" ) -- -function SCORING:New( GameName ) +function SCORING:New( GameName, SavePath, AutoSave ) -- Inherits from BASE local self = BASE:Inherit( self, BASE:New() ) -- #SCORING @@ -317,7 +319,8 @@ function SCORING:New( GameName ) end ) -- Create the CSV file. - self.AutoSave = true + self.AutoSavePath = SavePath + self.AutoSave = AutoSave or true self:OpenCSV( GameName ) return self @@ -1839,10 +1842,11 @@ end function SCORING:OpenCSV( ScoringCSV ) self:F( ScoringCSV ) - if lfs and io and os and self.AutoSave then + if lfs and io and os and self.AutoSave == true then if ScoringCSV then self.ScoringCSV = ScoringCSV - local fdir = lfs.writedir() .. [[Logs\]] .. self.ScoringCSV .. " " .. os.date( "%Y-%m-%d %H-%M-%S" ) .. ".csv" + local path = self.AutoSavePath or lfs.writedir() .. [[Logs\]] + local fdir = path .. self.ScoringCSV .. " " .. os.date( "%Y-%m-%d %H-%M-%S" ) .. ".csv" self.CSVFile, self.err = io.open( fdir, "w+" ) if not self.CSVFile then From b263cddc07c3df7e49c23d6fed4da004ffa5f4d6 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 24 Mar 2024 13:24:38 +0100 Subject: [PATCH 3/3] #MSRS - Fix for explicit Voice setting actually overwriting overall settings of a provider. --- Moose Development/Moose/Sound/SRS.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Sound/SRS.lua b/Moose Development/Moose/Sound/SRS.lua index 0d3315dcc..b27564a62 100644 --- a/Moose Development/Moose/Sound/SRS.lua +++ b/Moose Development/Moose/Sound/SRS.lua @@ -824,7 +824,7 @@ function MSRS:SetVoiceProvider(Voice, Provider) self:F( {Voice=Voice, Provider=Provider} ) self.poptions=self.poptions or {} - self.poptions[Provider or self:GetProvider()]=Voice + self.poptions[Provider or self:GetProvider()].voice=Voice return self end