Fix units being picked up when they no longer want it

This commit is contained in:
Gustas
2025-03-29 11:51:30 +02:00
committed by Paul Chote
parent 649e7e8c28
commit a3ee6645c1
3 changed files with 11 additions and 1 deletions

View File

@@ -115,6 +115,9 @@ namespace OpenRA.Mods.Common.Activities
}
else
{
foreach (var ndcm in notifyDockClientMoving)
ndcm.MovementCancelled(self);
// The dock explicitly chosen by the user is currently occupied. Wait and check again.
QueueChild(new Wait(dockClient.Info.SearchForDockDelay));
return false;

View File

@@ -158,6 +158,9 @@ namespace OpenRA.Mods.Common.Activities
if (!actualResupplyStarted && activeResupplyTypes > 0)
{
actualResupplyStarted = true;
foreach (var t in transportCallers)
t.MovementCancelled(self);
foreach (var notifyResupply in notifyResupplies)
notifyResupply.BeforeResupply(host.Actor, self, activeResupplyTypes);

View File

@@ -52,6 +52,10 @@ namespace OpenRA.Mods.Common.Traits
t.MovementCancelled(self);
}
void INotifyHarvestAction.Harvested(Actor self, string resourceType) { }
void INotifyHarvestAction.Harvested(Actor self, string resourceType)
{
foreach (var t in transports)
t.MovementCancelled(self);
}
}
}