diff --git a/Moose Development/Moose/Ops/FlightGroup.lua b/Moose Development/Moose/Ops/FlightGroup.lua index c3914282f..50f9116fa 100644 --- a/Moose Development/Moose/Ops/FlightGroup.lua +++ b/Moose Development/Moose/Ops/FlightGroup.lua @@ -837,7 +837,7 @@ function FLIGHTGROUP:Status() -- ROE and Alarm State. local roe=self:GetROE() or -1 - local als=self:GetAlarmstate() or -1 + local rot=self:GetROT() or -1 -- Waypoint stuff. local wpidxCurr=self.currentwp @@ -882,8 +882,8 @@ function FLIGHTGROUP:Status() local curr=self.currbase and self.currbase:GetName() or "N/A" -- Info text. - local text=string.format("%s [%d/%d]: ROE/AS=%d/%d | T/M=%d/%d | Wp=%d[%d]-->%d[%d]/%d [%s] | Life=%.1f | v=%.1f (%d) | Hdg=%03d | Ammo=%d | Detect=%s | Cargo=%.1f | Base=%s [%s-->%s]", - fsmstate, nelem, Nelem, roe, als, nTaskTot, nMissions, wpidxCurr, wpuidCurr, wpidxNext, wpuidNext, wpN, wpF, life, speed, speedEx, hdg, ammo, ndetected, cargo, curr, home, dest) + local text=string.format("%s [%d/%d]: ROE/ROT=%d/%d | T/M=%d/%d | Wp=%d[%d]-->%d[%d]/%d [%s] | Life=%.1f | v=%.1f (%d) | Hdg=%03d | Ammo=%d | Detect=%s | Cargo=%.1f | Base=%s [%s-->%s]", + fsmstate, nelem, Nelem, roe, rot, nTaskTot, nMissions, wpidxCurr, wpuidCurr, wpidxNext, wpuidNext, wpN, wpF, life, speed, speedEx, hdg, ammo, ndetected, cargo, curr, home, dest) self:I(self.lid..text) end diff --git a/Moose Development/Moose/Ops/OpsGroup.lua b/Moose Development/Moose/Ops/OpsGroup.lua index c2bb3b5b1..e9c282d4c 100644 --- a/Moose Development/Moose/Ops/OpsGroup.lua +++ b/Moose Development/Moose/Ops/OpsGroup.lua @@ -4395,6 +4395,7 @@ function OPSGROUP:onafterTaskDone(From, Event, To, Task) if Task.description=="Task_Land_At" then self:T(self.lid.."Taske DONE Task_Land_At ==> Wait") + self:Cruise() self:Wait(20, 100) else self:T(self.lid.."Task Done but NO mission found ==> _CheckGroupDone in 1 sec") @@ -4790,6 +4791,11 @@ function OPSGROUP:onafterMissionExecute(From, Event, To, Mission) -- Set mission status to EXECUTING. Mission:Executing() + + -- Group is holding but has waypoints ==> Cruise. + if self:IsHolding() and not self:HasPassedFinalWaypoint() then + self:Cruise() + end -- Set auto engage detected targets. if Mission.engagedetectedOn then @@ -9698,6 +9704,8 @@ function OPSGROUP:_CheckDamage() for _,_element in pairs(self.elements) do local element=_element --Ops.OpsGroup#OPSGROUP.Element + if element.status~=OPSGROUP.ElementStatus.DEAD and element.status~=OPSGROUP.ElementStatus.INUTERO then + -- Current life points. local life=element.unit:GetLife() @@ -9708,6 +9716,8 @@ function OPSGROUP:_CheckDamage() self:ElementDamaged(element) damaged=true end + + end end @@ -11845,7 +11855,7 @@ function OPSGROUP:GetAmmoTot() Ammo.MissilesCR=0 Ammo.MissilesSA=0 - for _,_unit in pairs(units) do + for _,_unit in pairs(units or {}) do local unit=_unit --Wrapper.Unit#UNIT if unit and unit:IsAlive()~=nil then