Fix crash with dead cargo.

This commit is contained in:
tovl
2019-08-30 19:28:47 +02:00
committed by abcdefg30
parent 4f99982ef1
commit 46c0b4cf31
2 changed files with 4 additions and 1 deletions

View File

@@ -53,6 +53,9 @@ namespace OpenRA.Mods.Common.Activities
{
self.World.AddFrameEndTask(w =>
{
if (self.IsDead)
return;
// Make sure the target hasn't changed while entering
// OnEnterComplete is only called if targetActor is alive
if (targetActor != enterActor)

View File

@@ -229,7 +229,7 @@ namespace OpenRA.Mods.Common.Traits
}
return !IsEmpty(self) && (aircraft == null || aircraft.CanLand(self.Location, blockedByMobile: false))
&& CurrentAdjacentCells != null && CurrentAdjacentCells.Any(c => Passengers.Any(p => p.Trait<IPositionable>().CanEnterCell(c, null, immediate)));
&& CurrentAdjacentCells != null && CurrentAdjacentCells.Any(c => Passengers.Any(p => !p.IsDead && p.Trait<IPositionable>().CanEnterCell(c, null, immediate)));
}
public bool CanLoad(Actor self, Actor a)