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.
|
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.
|
-- Now search for all squadrons located at the airbase, and sanatize them.
|
||||||
for SquadronName, Squadron in pairs( self.DefenderSquadrons ) do
|
for SquadronName, Squadron in pairs( self.DefenderSquadrons ) do
|
||||||
if Squadron.AirbaseName == AirbaseName then
|
if Squadron.AirbaseName == AirbaseName then
|
||||||
Squadron.Resources = -999 -- The base has been captured, and the resources are eliminated. No more spawning.
|
Squadron.Resources = -999 -- The base has been captured, and the resources are eliminated. No more spawning.
|
||||||
Squadron.Captured = true
|
Squadron.Captured = true
|
||||||
|
self:I( "Squadron " .. SquadronName .. " captured." )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1507,6 +1510,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
|
|
||||||
DefenderSquadron.Name = SquadronName
|
DefenderSquadron.Name = SquadronName
|
||||||
DefenderSquadron.Airbase = AIRBASE:FindByName( AirbaseName )
|
DefenderSquadron.Airbase = AIRBASE:FindByName( AirbaseName )
|
||||||
|
DefenderSquadron.AirbaseName = DefenderSquadron.Airbase:GetName()
|
||||||
if not DefenderSquadron.Airbase then
|
if not DefenderSquadron.Airbase then
|
||||||
error( "Cannot find airbase with name:" .. AirbaseName )
|
error( "Cannot find airbase with name:" .. AirbaseName )
|
||||||
end
|
end
|
||||||
|
|||||||
@ -334,7 +334,7 @@ end
|
|||||||
--- Find a AIRBASE in the _DATABASE using the name of an existing DCS Airbase.
|
--- Find a AIRBASE in the _DATABASE using the name of an existing DCS Airbase.
|
||||||
-- @param #AIRBASE self
|
-- @param #AIRBASE self
|
||||||
-- @param #string AirbaseName The Airbase Name.
|
-- @param #string AirbaseName The Airbase Name.
|
||||||
-- @return Wrapper.Airbase#AIRBASE self
|
-- @return #AIRBASE self
|
||||||
function AIRBASE:FindByName( AirbaseName )
|
function AIRBASE:FindByName( AirbaseName )
|
||||||
|
|
||||||
local AirbaseFound = _DATABASE:FindAirbase( AirbaseName )
|
local AirbaseFound = _DATABASE:FindAirbase( AirbaseName )
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user