From 98d4af18a4a37e89a2ec067d0f06d5da2352f29a Mon Sep 17 00:00:00 2001 From: Kenny Hoxworth Date: Mon, 28 Nov 2011 14:20:21 -0500 Subject: [PATCH] Don't cancel the FlyAttack activity if the activity has already been canceled. The Tick routine calls Cancel() on FlyAttack, which removes any NextActivity that may have been set by an outside listener. This is the case with a rare bug causing planes to be killed, removed from the playable game, but still existing in the game world. --- OpenRA.Mods.RA/Air/FlyAttack.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.RA/Air/FlyAttack.cs b/OpenRA.Mods.RA/Air/FlyAttack.cs index efc7f68547..c4bb4aa2bd 100755 --- a/OpenRA.Mods.RA/Air/FlyAttack.cs +++ b/OpenRA.Mods.RA/Air/FlyAttack.cs @@ -46,10 +46,13 @@ namespace OpenRA.Mods.RA.Air public override void Cancel( Actor self ) { - if( inner != null ) - inner.Cancel( self ); + if( !IsCanceled ) + { + if( inner != null ) + inner.Cancel( self ); - base.Cancel( self ); + base.Cancel( self ); + } } } }