From 659615114aca1e5ac0f02b9021f5bf9d041beb76 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Fri, 28 Mar 2025 15:04:42 +0100 Subject: [PATCH 1/2] xx --- Moose Development/Moose/AI/AI_BAI.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Moose Development/Moose/AI/AI_BAI.lua b/Moose Development/Moose/AI/AI_BAI.lua index 9877ac51b..ec338e30b 100644 --- a/Moose Development/Moose/AI/AI_BAI.lua +++ b/Moose Development/Moose/AI/AI_BAI.lua @@ -174,8 +174,7 @@ function AI_BAI_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude -- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM. -- @param #string From The From State string. -- @param #string Event The Event string. - -- @param #string To The To State string. - + -- @param #string To The To State string. -- @return #boolean Return false to cancel Transition. --- OnAfter Transition Handler for Event Engage. From 0a38700edbe50c10fce8c234c33cf13c2e19870b Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Fri, 28 Mar 2025 15:05:30 +0100 Subject: [PATCH 2/2] #AI_Patrol - small enhancement --- Moose Development/Moose/AI/AI_Patrol.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/AI/AI_Patrol.lua b/Moose Development/Moose/AI/AI_Patrol.lua index d5ce61d72..e6516736a 100644 --- a/Moose Development/Moose/AI/AI_Patrol.lua +++ b/Moose Development/Moose/AI/AI_Patrol.lua @@ -846,7 +846,6 @@ function AI_PATROL_ZONE:onafterStatus() OldAIControllable:SetTask( TimedOrbitTask, 10 ) RTB = true - else end -- TODO: Check GROUP damage function. @@ -856,6 +855,16 @@ function AI_PATROL_ZONE:onafterStatus() RTB = true end + if self:IsInstanceOf("AI_CAS") or self:IsInstanceOf("AI_BAI") then + local atotal,shells,rockets,bombs,missiles = self.Controllable:GetAmmunition() + local arelevant = rockets+bombs + if arelevant == 0 or missiles == 0 then + RTB = true + self:T({total=atotal,shells=shells,rockets=rockets,bombs=bombs,missiles=missiles}) + self:T( self.Controllable:GetName() .. " is out of ammo, RTB!" ) + end + end + if RTB == true then self:RTB() else