Skip to content

Commit ff5205e

Browse files
Merge pull request #2590 from FlightControl-Master/master-ng
Merge from master
2 parents aec3466 + ebd105f commit ff5205e

3 files changed

Lines changed: 279 additions & 10 deletions

File tree

Moose Development/Moose/Functional/Shorad.lua

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -795,15 +795,20 @@ do
795795
local tgtgrp1 = self.Samset:FindNearestGroupFromPointVec2(tgtcoord)
796796
local tgtcoord1 = tgtgrp1:GetCoordinate()
797797
local tgtgrp2 = self.Groupset:FindNearestGroupFromPointVec2(tgtcoord)
798-
local tgtcoord2 = tgtgrp2:GetCoordinate()
799-
local dist1 = tgtcoord:Get2DDistance(tgtcoord1)
800-
local dist2 = tgtcoord:Get2DDistance(tgtcoord2)
801-
802-
if dist1 < dist2 then
803-
targetunit = tgtgrp1
804-
targetcat = Object.Category.UNIT
798+
if tgtgrp2 then
799+
local tgtcoord2 = tgtgrp2:GetCoordinate()
800+
local dist1 = tgtcoord:Get2DDistance(tgtcoord1)
801+
local dist2 = tgtcoord:Get2DDistance(tgtcoord2)
802+
803+
if dist1 < dist2 then
804+
targetunit = tgtgrp1
805+
targetcat = Object.Category.UNIT
806+
else
807+
targetunit = tgtgrp2
808+
targetcat = Object.Category.UNIT
809+
end
805810
else
806-
targetunit = tgtgrp2
811+
targetunit = tgtgrp1
807812
targetcat = Object.Category.UNIT
808813
end
809814
end

Moose Development/Moose/Ops/CTLD.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ do
204204
-- my_ctld.C130DynamicCargoAutoBuildMergeSeconds = 0 -- Merge window in seconds for C-130 auto-build handoff; set to 0 to disable batching (default).
205205
-- my_ctld.locale = "en" -- Language locale to use.
206206
-- -- Supported: "en" English (default), "de" German, "fr" French, "es" Spanish,
207-
-- -- "pt-br" Brazilian Portuguese, "ru" Russian, "tr" Turkish, "zh-cn" Simplified Chinese (Mainland China), "zh-tw" Traditional Chinese (Taiwan).
207+
-- -- "it" Italian, "pt-br" Brazilian Portuguese, "ru" Russian, "tr" Turkish,
208+
-- -- "zh-cn" Simplified Chinese (Mainland China), "zh-tw" Traditional Chinese (Taiwan).
208209
--
209210
-- ## 2.1 CH-47 Chinook support
210211
--
@@ -1499,7 +1500,7 @@ function CTLD:_InitLocalization()
14991500
end
15001501

15011502
--- [User] Set a resolver used to select a CTLD locale for group-specific menus and messages.
1502-
-- Supported locales: "en", "de", "fr", "es", "pt-br", "ru", "tr", "zh-cn", "zh-tw".
1503+
-- Supported locales: "en", "de", "fr", "es", "it", "pt-br", "ru", "tr", "zh-cn", "zh-tw".
15031504
-- If unset, CTLD keeps using `self.locale` as before.
15041505
-- @param #CTLD self
15051506
-- @param #function Resolver Function called as `Resolver(self, Group)` and expected to return a locale string.
@@ -1542,6 +1543,10 @@ function CTLD:_GetMenuPluralSuffix(Count, Kind, Group)
15421543
return "ов"
15431544
end
15441545
if locale == "tr" then return "" end
1546+
if locale == "it" then
1547+
if Kind == "crate" then return count > 1 and "e" or "a" end
1548+
if Kind == "set" then return "" end
1549+
end
15451550
if locale == "de" and Kind == "crate" then return count > 1 and "n" or "" end
15461551
return count > 1 and "s" or ""
15471552
end

0 commit comments

Comments
 (0)