Uncloak during resupply when "UncloakOn: Dock" is defined

This commit is contained in:
abcdefg30
2020-05-18 17:19:27 +02:00
committed by teinarss
parent dbe824d4e5
commit dd99fc93e4
3 changed files with 33 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ namespace OpenRA.Mods.Common.Activities
readonly RepairableNear repairableNear;
readonly Rearmable rearmable;
readonly INotifyResupply[] notifyResupplies;
readonly INotifyBeingResupplied[] notifyBeingResupplied;
readonly ICallForTransport[] transportCallers;
readonly IMove move;
readonly Aircraft aircraft;
@@ -53,6 +54,7 @@ namespace OpenRA.Mods.Common.Activities
repairableNear = self.TraitOrDefault<RepairableNear>();
rearmable = self.TraitOrDefault<Rearmable>();
notifyResupplies = host.TraitsImplementing<INotifyResupply>().ToArray();
notifyBeingResupplied = self.TraitsImplementing<INotifyBeingResupplied>().ToArray();
transportCallers = self.TraitsImplementing<ICallForTransport>().ToArray();
move = self.Trait<IMove>();
aircraft = move as Aircraft;
@@ -149,6 +151,9 @@ namespace OpenRA.Mods.Common.Activities
actualResupplyStarted = true;
foreach (var notifyResupply in notifyResupplies)
notifyResupply.BeforeResupply(host.Actor, self, activeResupplyTypes);
foreach (var br in notifyBeingResupplied)
br.StartingResupply(self, host.Actor);
}
if (activeResupplyTypes.HasFlag(ResupplyType.Repair))
@@ -237,6 +242,9 @@ namespace OpenRA.Mods.Common.Activities
else if (repairableNear == null && !(self.CurrentActivity.NextActivity is Move))
QueueChild(move.MoveToTarget(self, host));
}
foreach (var br in notifyBeingResupplied)
br.StoppingResupply(self, isHostInvalid ? null : host.Actor);
}
void RepairTick(Actor self)