Fix IDE0039
This commit is contained in:
@@ -94,7 +94,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Beacon beacon = null;
|
||||
var aircraftInRange = new Dictionary<Actor, bool>();
|
||||
|
||||
Action<Actor> onEnterRange = a =>
|
||||
void OnEnterRange(Actor a)
|
||||
{
|
||||
// Spawn a camera and remove the beacon when the first plane enters the target area
|
||||
if (info.CameraActor != null && camera == null && !aircraftInRange.Any(kv => kv.Value))
|
||||
@@ -112,18 +112,18 @@ namespace OpenRA.Mods.Common.Traits
|
||||
RemoveBeacon(beacon);
|
||||
|
||||
aircraftInRange[a] = true;
|
||||
};
|
||||
}
|
||||
|
||||
Action<Actor> onExitRange = a =>
|
||||
void OnExitRange(Actor a)
|
||||
{
|
||||
aircraftInRange[a] = false;
|
||||
|
||||
// Remove the camera when the final plane leaves the target area
|
||||
if (!aircraftInRange.Any(kv => kv.Value))
|
||||
RemoveCamera(camera);
|
||||
};
|
||||
}
|
||||
|
||||
Action<Actor> onRemovedFromWorld = a =>
|
||||
void OnRemovedFromWorld(Actor a)
|
||||
{
|
||||
aircraftInRange[a] = false;
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
RemoveCamera(camera);
|
||||
RemoveBeacon(beacon);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Create the actors immediately so they can be returned
|
||||
for (var i = -info.SquadSize / 2; i <= info.SquadSize / 2; i++)
|
||||
@@ -160,9 +160,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
var attack = a.Trait<AttackBomber>();
|
||||
attack.SetTarget(target + targetOffset);
|
||||
attack.OnEnteredAttackRange += onEnterRange;
|
||||
attack.OnExitedAttackRange += onExitRange;
|
||||
attack.OnRemovedFromWorld += onRemovedFromWorld;
|
||||
attack.OnEnteredAttackRange += OnEnterRange;
|
||||
attack.OnExitedAttackRange += OnExitRange;
|
||||
attack.OnRemovedFromWorld += OnRemovedFromWorld;
|
||||
}
|
||||
|
||||
self.World.AddFrameEndTask(w =>
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Beacon beacon = null;
|
||||
var aircraftInRange = new Dictionary<Actor, bool>();
|
||||
|
||||
Action<Actor> onEnterRange = a =>
|
||||
void OnEnterRange(Actor a)
|
||||
{
|
||||
// Spawn a camera and remove the beacon when the first plane enters the target area
|
||||
if (info.CameraActor != null && camera == null && !aircraftInRange.Any(kv => kv.Value))
|
||||
@@ -145,18 +145,18 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
aircraftInRange[a] = true;
|
||||
};
|
||||
}
|
||||
|
||||
Action<Actor> onExitRange = a =>
|
||||
void OnExitRange(Actor a)
|
||||
{
|
||||
aircraftInRange[a] = false;
|
||||
|
||||
// Remove the camera when the final plane leaves the target area
|
||||
if (!aircraftInRange.Any(kv => kv.Value))
|
||||
RemoveCamera(camera);
|
||||
};
|
||||
}
|
||||
|
||||
Action<Actor> onRemovedFromWorld = a =>
|
||||
void OnRemovedFromWorld(Actor a)
|
||||
{
|
||||
aircraftInRange[a] = false;
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
RemoveCamera(camera);
|
||||
RemoveBeacon(beacon);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Create the actors immediately so they can be returned
|
||||
for (var i = -info.SquadSize / 2; i <= info.SquadSize / 2; i++)
|
||||
@@ -221,9 +221,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
var drop = a.Trait<ParaDrop>();
|
||||
drop.SetLZ(w.Map.CellContaining(target + targetOffset), !info.AllowImpassableCells);
|
||||
drop.OnEnteredDropRange += onEnterRange;
|
||||
drop.OnExitedDropRange += onExitRange;
|
||||
drop.OnRemovedFromWorld += onRemovedFromWorld;
|
||||
drop.OnEnteredDropRange += OnEnterRange;
|
||||
drop.OnExitedDropRange += OnExitRange;
|
||||
drop.OnRemovedFromWorld += OnRemovedFromWorld;
|
||||
|
||||
var cargo = a.Trait<Cargo>();
|
||||
foreach (var unit in units.Skip(added).Take(passengersPerPlane))
|
||||
|
||||
Reference in New Issue
Block a user