Fix a NRE in DeliverUnit.ReleaseUnit.OnFirstRun

This commit is contained in:
abcdefg30
2021-08-04 23:09:23 +02:00
committed by Paul Chote
parent 6e0917169d
commit dc11b82fc9

View File

@@ -78,6 +78,11 @@ namespace OpenRA.Mods.Common.Activities
protected override void OnFirstRun(Actor self) protected override void OnFirstRun(Actor self)
{ {
// HACK: Activities still tick between the actor being killed and being disposed
// Thus the carryable might have changed since queuing because the death handler set it to null
if (carryall.Carryable == null)
return;
self.Trait<Aircraft>().RemoveInfluence(); self.Trait<Aircraft>().RemoveInfluence();
var localOffset = carryall.CarryableOffset.Rotate(body.QuantizeOrientation(self, self.Orientation)); var localOffset = carryall.CarryableOffset.Rotate(body.QuantizeOrientation(self, self.Orientation));