diff --git a/OpenRA.Mods.Common/Activities/RideTransport.cs b/OpenRA.Mods.Common/Activities/RideTransport.cs index ea5fd8c1d9..1b451fa7e0 100644 --- a/OpenRA.Mods.Common/Activities/RideTransport.cs +++ b/OpenRA.Mods.Common/Activities/RideTransport.cs @@ -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) diff --git a/OpenRA.Mods.Common/Traits/Cargo.cs b/OpenRA.Mods.Common/Traits/Cargo.cs index 20630e9883..be4a538bcf 100644 --- a/OpenRA.Mods.Common/Traits/Cargo.cs +++ b/OpenRA.Mods.Common/Traits/Cargo.cs @@ -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().CanEnterCell(c, null, immediate))); + && CurrentAdjacentCells != null && CurrentAdjacentCells.Any(c => Passengers.Any(p => !p.IsDead && p.Trait().CanEnterCell(c, null, immediate))); } public bool CanLoad(Actor self, Actor a)