Skip to content

Commit

Permalink
QoL
Browse files Browse the repository at this point in the history
  • Loading branch information
Applevangelist committed Sep 6, 2024
2 parents 8695953 + f00d0dc commit 6243137
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
7 changes: 6 additions & 1 deletion Moose Development/Moose/AI/AI_A2G_Dispatcher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3895,10 +3895,14 @@ do -- AI_A2G_DISPATCHER

if Squadron then
local FirstUnit = AttackSetUnit:GetRandomSurely()
if FirstUnit then
local Coordinate = FirstUnit:GetCoordinate() -- Core.Point#COORDINATE
if self.SetSendPlayerMessages then
Dispatcher:MessageToPlayers( Squadron, DefenderName .. ", on route to ground target at " .. Coordinate:ToStringA2G( DefenderGroup ), DefenderGroup )
end
else
return
end
end
self:GetParent(self).onafterEngageRoute( self, DefenderGroup, From, Event, To, AttackSetUnit )
end
Expand Down Expand Up @@ -4784,4 +4788,5 @@ end
Squadron.ResourceCount = Squadron.ResourceCount - Amount
end
self:T({Squadron = Squadron.Name,SquadronResourceCount = Squadron.ResourceCount})
end
end

11 changes: 6 additions & 5 deletions Moose Development/Moose/Functional/Detection.lua
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,8 @@ do -- DETECTION_BASE

return self
end


---
-- @param #DETECTION_BASE self
-- @param #string From The From State string.
-- @param #string Event The Event string.
Expand All @@ -615,7 +616,7 @@ do -- DETECTION_BASE
self:T( { "DetectionGroup is Alive", Detection:GetName() } )

local DetectionGroupName = Detection:GetName()
local DetectionUnit = Detection:GetUnit( 1 )
local DetectionUnit = Detection:GetFirstUnitAlive()

local DetectedUnits = {}

Expand All @@ -632,20 +633,20 @@ do -- DETECTION_BASE
--self:T(UTILS.PrintTableToLog(DetectedTargets))


for DetectionObjectID, Detection in pairs( DetectedTargets ) do
for DetectionObjectID, Detection in pairs( DetectedTargets or {}) do
local DetectedObject = Detection.object -- DCS#Object

if DetectedObject and DetectedObject:isExist() and DetectedObject.id_ < 50000000 then -- and ( DetectedObject:getCategory() == Object.Category.UNIT or DetectedObject:getCategory() == Object.Category.STATIC ) then
local DetectedObjectName = DetectedObject:getName()
if not self.DetectedObjects[DetectedObjectName] then
self.DetectedObjects[DetectedObjectName] = self.DetectedObjects[DetectedObjectName] or {}
self.DetectedObjects[DetectedObjectName].Name = DetectedObjectName
self.DetectedObjects[DetectedObjectName].Name = DetectedObjectName
self.DetectedObjects[DetectedObjectName].Object = DetectedObject
end
end
end

for DetectionObjectName, DetectedObjectData in pairs( self.DetectedObjects ) do
for DetectionObjectName, DetectedObjectData in pairs( self.DetectedObjects or {}) do

local DetectedObject = DetectedObjectData.Object

Expand Down
2 changes: 1 addition & 1 deletion Moose Development/Moose/Functional/Warehouse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6732,7 +6732,7 @@ end
-- @param Wrapper.Group#GROUP deadgroup Group of unit that died.
-- @param #WAREHOUSE.Pendingitem request Request that needs to be updated.
function WAREHOUSE:_UnitDead(deadunit, deadgroup, request)
self:F(self.lid.."FF unit dead "..deadunit:GetName())
--self:F(self.lid.."FF unit dead "..deadunit:GetName())

-- Find opsgroup.
local opsgroup=_DATABASE:FindOpsGroup(deadgroup)
Expand Down
2 changes: 1 addition & 1 deletion Moose Development/Moose/Ops/Airboss.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14680,7 +14680,7 @@ function AIRBOSS:_GetPlayerUnitAndName( _unitName )
-- Get DCS unit from its name.
local DCSunit = Unit.getByName( _unitName )

if DCSunit then
if DCSunit and DCSunit.getPlayerName then

-- Get player name if any.
local playername = DCSunit:getPlayerName()
Expand Down

0 comments on commit 6243137

Please sign in to comment.