Fix crash for invalid Resupply hosts.

This commit is contained in:
Paul Chote
2019-08-17 12:08:26 +01:00
committed by abcdefg30
parent 2a6f2bbe0e
commit e600848947

View File

@@ -169,7 +169,7 @@ namespace OpenRA.Mods.Common.Activities
void OnResupplyEnding(Actor self, bool isHostInvalid = false) void OnResupplyEnding(Actor self, bool isHostInvalid = false)
{ {
var rp = host.Actor.TraitOrDefault<RallyPoint>(); var rp = !isHostInvalid ? host.Actor.TraitOrDefault<RallyPoint>() : null;
if (aircraft != null) if (aircraft != null)
{ {
if (wasRepaired || isHostInvalid || (!stayOnResupplier && aircraft.Info.TakeOffOnResupply)) if (wasRepaired || isHostInvalid || (!stayOnResupplier && aircraft.Info.TakeOffOnResupply))