Prevent carryalls delivering non-existent units.

This commit is contained in:
tovl
2019-06-30 23:20:10 +02:00
committed by abcdefg30
parent 768043bc4e
commit 0562814efa

View File

@@ -41,6 +41,12 @@ namespace OpenRA.Mods.Common.Activities
protected override void OnFirstRun(Actor self) protected override void OnFirstRun(Actor self)
{ {
// In case this activity was queued (either via queued order of via AutoCarryall)
// something might have happened to the cargo in the time between the activity being
// queued and being run, so short out if it is no longer valid.
if (carryall.Carryable == null)
return;
if (assignTargetOnFirstRun) if (assignTargetOnFirstRun)
destination = Target.FromCell(self.World, self.Location); destination = Target.FromCell(self.World, self.Location);