From 5f8d1cf5b0c45fb3a8bdad0364afe84212b1300d Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 1 Oct 2024 09:07:51 +0200 Subject: [PATCH 1/2] Update Warehouse.lua - Added check for incorrect plane attribute --- Moose Development/Moose/Functional/Warehouse.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Functional/Warehouse.lua b/Moose Development/Moose/Functional/Warehouse.lua index b7a69a44e..e5fc12157 100644 --- a/Moose Development/Moose/Functional/Warehouse.lua +++ b/Moose Development/Moose/Functional/Warehouse.lua @@ -8433,12 +8433,14 @@ function WAREHOUSE:_GetAttribute(group) local attribute=WAREHOUSE.Attribute.OTHER_UNKNOWN --#WAREHOUSE.Attribute if group then + + local groupCat=group:GetCategory() ----------- --- Air --- ----------- -- Planes - local transportplane=group:HasAttribute("Transports") and group:HasAttribute("Planes") + local transportplane=group:HasAttribute("Transports") and group:HasAttribute("Planes") and groupCat==Group.Category.AIRPLANE local awacs=group:HasAttribute("AWACS") local fighter=group:HasAttribute("Fighters") or group:HasAttribute("Interceptors") or group:HasAttribute("Multirole fighters") or (group:HasAttribute("Bombers") and not group:HasAttribute("Strategic bombers")) local bomber=group:HasAttribute("Strategic bombers") From 3524cba4efdeee2132446ef9d0d5a25e11d12acc Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Tue, 1 Oct 2024 12:08:45 +0200 Subject: [PATCH 2/2] xx --- Moose Development/Moose/Core/Database.lua | 21 +++++++++++++++++++-- Moose Development/Moose/Wrapper/Airbase.lua | 19 +++++++++++++++---- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/Moose Development/Moose/Core/Database.lua b/Moose Development/Moose/Core/Database.lua index bb5d65987..6270f1fa6 100644 --- a/Moose Development/Moose/Core/Database.lua +++ b/Moose Development/Moose/Core/Database.lua @@ -1582,12 +1582,29 @@ end -- @param DCS#Airbase airbase Airbase. -- @return #DATABASE self function DATABASE:_RegisterAirbase(airbase) - + + local IsSyria = UTILS.GetDCSMap() == "Syria" and true or false + local countHSyria = 0 + if airbase then -- Get the airbase name. local DCSAirbaseName = airbase:getName() - + + -- DCS 2.9.8.1107 added 143 helipads all named H with the same object ID .. + if IsSyria and DCSAirbaseName == "H" and countHSyria > 0 then + --[[ + local p = airbase:getPosition().p + local mgrs = COORDINATE:New(p.x,p.z,p.y):ToStringMGRS() + self:I("Airbase on Syria map named H @ "..mgrs) + countHSyria = countHSyria + 1 + if countHSyria > 1 then return self end + --]] + return self + elseif IsSyria and DCSAirbaseName == "H" and countHSyria == 0 then + countHSyria = countHSyria + 1 + end + -- This gave the incorrect value to be inserted into the airdromeID for DCS 2.5.6. Is fixed now. local airbaseID=airbase:getID() diff --git a/Moose Development/Moose/Wrapper/Airbase.lua b/Moose Development/Moose/Wrapper/Airbase.lua index 4759ebf2f..21cf26938 100644 --- a/Moose Development/Moose/Wrapper/Airbase.lua +++ b/Moose Development/Moose/Wrapper/Airbase.lua @@ -63,6 +63,11 @@ -- To be able to distinguish easily in your code the difference between a AIRBASE API call and a DCS Airbase API call, -- the first letter of the method is also capitalized. So, by example, the DCS Airbase method DCSWrapper.Airbase#Airbase.getName() -- is implemented in the AIRBASE class as @{#AIRBASE.GetName}(). +-- +-- ## Note on the "H" heli pads in the Syria map: +-- +-- As of the time of writing (Oct 2024, DCS DCS 2.9.8.1107), these 143 objects have the **same name and object ID**, which makes them unusable in Moose, e.g. you cannot find a specific one for spawning etc. +-- Waiting for Ugra and ED to fix this issue. -- -- @field #AIRBASE AIRBASE AIRBASE = { @@ -450,6 +455,7 @@ AIRBASE.TheChannel = { -- * AIRBASE.Syria.Gaziantep -- * AIRBASE.Syria.Gazipasa -- * AIRBASE.Syria.Gecitkale +-- * AIRBASE.Syria.H -- * AIRBASE.Syria.H3 -- * AIRBASE.Syria.H3_Northwest -- * AIRBASE.Syria.H3_Southwest @@ -518,6 +524,7 @@ AIRBASE.Syria={ ["Gaziantep"] = "Gaziantep", ["Gazipasa"] = "Gazipasa", ["Gecitkale"] = "Gecitkale", + ["H"] = "H", ["H3"] = "H3", ["H3_Northwest"] = "H3 Northwest", ["H3_Southwest"] = "H3 Southwest", @@ -752,12 +759,14 @@ AIRBASE.Sinai = { -- -- * AIRBASE.Kola.Banak -- * AIRBASE.Kola.Bodo +-- * AIRBASE.Kola.Ivalo -- * AIRBASE.Kola.Jokkmokk -- * AIRBASE.Kola.Kalixfors -- * AIRBASE.Kola.Kallax -- * AIRBASE.Kola.Kemi_Tornio -- * AIRBASE.Kola.Kirkenes -- * AIRBASE.Kola.Kiruna +-- * AIRBASE.Kola.Kuusamo -- * AIRBASE.Kola.Monchegorsk -- * AIRBASE.Kola.Murmansk_International -- * AIRBASE.Kola.Olenya @@ -771,20 +780,22 @@ AIRBASE.Sinai = { AIRBASE.Kola = { ["Banak"] = "Banak", ["Bodo"] = "Bodo", + ["Ivalo"] = "Ivalo", ["Jokkmokk"] = "Jokkmokk", ["Kalixfors"] = "Kalixfors", + ["Kallax"] = "Kallax", ["Kemi_Tornio"] = "Kemi Tornio", + ["Kirkenes"] = "Kirkenes", ["Kiruna"] = "Kiruna", + ["Kuusamo"] = "Kuusamo", ["Monchegorsk"] = "Monchegorsk", ["Murmansk_International"] = "Murmansk International", ["Olenya"] = "Olenya", ["Rovaniemi"] = "Rovaniemi", ["Severomorsk_1"] = "Severomorsk-1", ["Severomorsk_3"] = "Severomorsk-3", - ["Vuojarvi"] = "Vuojarvi", - ["Kirkenes"] = "Kirkenes", - ["Kallax"] = "Kallax", ["Vidsel"] = "Vidsel", + ["Vuojarvi"] = "Vuojarvi", } --- Airbases of the Afghanistan map @@ -926,7 +937,7 @@ function AIRBASE:Register(AirbaseName) -- Debug info. --self:I({airbase=AirbaseName, descriptors=self.descriptors}) - + -- Category. self.category=self.descriptors and self.descriptors.category or Airbase.Category.AIRDROME