mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Fixing a mistake on capture.
This commit is contained in:
parent
a60626468c
commit
4171cc45f5
@ -1023,11 +1023,14 @@ do -- AI_A2A_DISPATCHER
|
||||
|
||||
local AirbaseName = EventData.PlaceName -- The name of the airbase that was captured.
|
||||
|
||||
self:I( "Captured " .. AirbaseName )
|
||||
|
||||
-- Now search for all squadrons located at the airbase, and sanatize them.
|
||||
for SquadronName, Squadron in pairs( self.DefenderSquadrons ) do
|
||||
if Squadron.AirbaseName == AirbaseName then
|
||||
Squadron.Resources = -999 -- The base has been captured, and the resources are eliminated. No more spawning.
|
||||
Squadron.Captured = true
|
||||
self:I( "Squadron " .. SquadronName .. " captured." )
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -1507,6 +1510,7 @@ do -- AI_A2A_DISPATCHER
|
||||
|
||||
DefenderSquadron.Name = SquadronName
|
||||
DefenderSquadron.Airbase = AIRBASE:FindByName( AirbaseName )
|
||||
DefenderSquadron.AirbaseName = DefenderSquadron.Airbase:GetName()
|
||||
if not DefenderSquadron.Airbase then
|
||||
error( "Cannot find airbase with name:" .. AirbaseName )
|
||||
end
|
||||
|
||||
@ -334,7 +334,7 @@ end
|
||||
--- Find a AIRBASE in the _DATABASE using the name of an existing DCS Airbase.
|
||||
-- @param #AIRBASE self
|
||||
-- @param #string AirbaseName The Airbase Name.
|
||||
-- @return Wrapper.Airbase#AIRBASE self
|
||||
-- @return #AIRBASE self
|
||||
function AIRBASE:FindByName( AirbaseName )
|
||||
|
||||
local AirbaseFound = _DATABASE:FindAirbase( AirbaseName )
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user