mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
WAREHOUSE
- Added runway destroyed check.
This commit is contained in:
@@ -2846,7 +2846,7 @@ function AUFTRAG:_TargetFromObject(Object)
|
||||
end
|
||||
|
||||
-- Debug info.
|
||||
self:T(self.lid..string.format("Mission Target %s Type=%s, Ntargets=%d, Lifepoints=%d", self.engageTarget.lid, self.engageTarget.lid, self.engageTarget.Ntargets0, self.engageTarget:GetLife()))
|
||||
self:I(self.lid..string.format("Mission Target %s Type=%s, Ntargets=%d, Lifepoints=%d", self.engageTarget.lid, self.engageTarget.lid, self.engageTarget.Ntargets0, self.engageTarget:GetLife()))
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -2781,6 +2781,10 @@ function OPSGROUP:RouteToMission(mission, delay)
|
||||
-- Delayed call.
|
||||
self:ScheduleOnce(delay, OPSGROUP.RouteToMission, self, mission)
|
||||
else
|
||||
|
||||
if self:IsDead() then
|
||||
return
|
||||
end
|
||||
|
||||
-- ID of current waypoint.
|
||||
local uid=self:GetWaypointCurrent().uid
|
||||
|
||||
@@ -549,11 +549,21 @@ end
|
||||
function SQUADRON:AddTacanChannel(ChannelMin, ChannelMax)
|
||||
|
||||
ChannelMax=ChannelMax or ChannelMin
|
||||
|
||||
if ChannelMin>126 then
|
||||
self:E(self.lid.."ERROR: TACAN Channel must be <= 126! Will not add to available channels")
|
||||
return self
|
||||
end
|
||||
if ChannelMax>126 then
|
||||
self:E(self.lid.."WARNING: TACAN Channel must be <= 126! Adjusting ChannelMax to 126")
|
||||
ChannelMax=126
|
||||
end
|
||||
|
||||
for i=ChannelMin,ChannelMax do
|
||||
self.tacanChannel[i]=true
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Get an unused TACAN channel.
|
||||
|
||||
@@ -425,7 +425,7 @@ function TARGET:OnEventUnitDeadOrLost(EventData)
|
||||
if EventData and EventData.IniUnitName then
|
||||
|
||||
-- Debug info.
|
||||
self:I(self.lid..string.format("EVENT: Unit %s dead or lost!", EventData.IniUnitName))
|
||||
self:T(self.lid..string.format("EVENT: Unit %s dead or lost!", tostring(EventData.IniUnitName)))
|
||||
|
||||
-- Get target.
|
||||
local target=self:GetTargetByName(EventData.IniUnitName)
|
||||
@@ -438,7 +438,7 @@ function TARGET:OnEventUnitDeadOrLost(EventData)
|
||||
if target and target.Status==TARGET.ObjectStatus.ALIVE then
|
||||
|
||||
-- Debug message.
|
||||
self:I(self.lid..string.format("EVENT: target unit %s dead or lost ==> destroyed", target.Name))
|
||||
self:T(self.lid..string.format("EVENT: target unit %s dead or lost ==> destroyed", tostring(target.Name)))
|
||||
|
||||
-- Trigger object destroyed event.
|
||||
self:ObjectDestroyed(target)
|
||||
@@ -1008,7 +1008,7 @@ function TARGET:CountTargets()
|
||||
|
||||
for _,_unit in pairs(units or {}) do
|
||||
local unit=_unit --Wrapper.Unit#UNIT
|
||||
if unit and unit:IsAlive() and unit:GetLife()>1 then
|
||||
if unit and unit:IsAlive()~=nil and unit:GetLife()>1 then
|
||||
N=N+1
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user