Skip to content

Commit

Permalink
fix crash in Missile.Tick when the target is killed while the missile…
Browse files Browse the repository at this point in the history
… is enroute
  • Loading branch information
chrisforbes committed Aug 26, 2010
1 parent 58ebd68 commit c7f8921
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OpenRA.Mods.RA/Effects/Missile.cs
Expand Up @@ -76,7 +76,7 @@ public void Tick( World world )
var targetPosition = Args.target.CenterLocation + offset;

var targetAltitude = 0;
if (Args.target.IsActor && Args.target.Actor.HasTrait<IMove>())
if (Args.target.IsValid && Args.target.IsActor && Args.target.Actor.HasTrait<IMove>())
targetAltitude = Args.target.Actor.Trait<IMove>().Altitude;
Altitude += Math.Sign(targetAltitude - Altitude);

Expand Down

0 comments on commit c7f8921

Please sign in to comment.