diff --git a/OpenRA.Mods.Common/Traits/Player/EnemyWatcher.cs b/OpenRA.Mods.Common/Traits/Player/EnemyWatcher.cs index 2469ac9479..257995df43 100644 --- a/OpenRA.Mods.Common/Traits/Player/EnemyWatcher.cs +++ b/OpenRA.Mods.Common/Traits/Player/EnemyWatcher.cs @@ -75,6 +75,9 @@ namespace OpenRA.Mods.Common.Traits || self.Owner.Stances[actor.Actor.Owner] != Stance.Enemy) continue; + if (actor.Actor.IsDead || !actor.Actor.IsInWorld) + continue; + // The actor is not currently visible if (!self.Owner.Shroud.IsVisible(actor.Actor)) continue; diff --git a/OpenRA.Mods.D2k/Activities/SwallowActor.cs b/OpenRA.Mods.D2k/Activities/SwallowActor.cs index b38e7ccb43..b9ee1a0a32 100644 --- a/OpenRA.Mods.D2k/Activities/SwallowActor.cs +++ b/OpenRA.Mods.D2k/Activities/SwallowActor.cs @@ -115,11 +115,7 @@ namespace OpenRA.Mods.D2k.Activities if (self.World.SharedRandom.Next() % 100 <= sandworm.Info.ChanceToDisappear) { self.CancelActivity(); - self.World.AddFrameEndTask(w => w.Remove(self)); - - var wormManager = self.World.WorldActor.TraitOrDefault(); - if (wormManager != null) - wormManager.DecreaseWormCount(); + self.World.AddFrameEndTask(w => self.Kill(self)); } else renderUnit.DefaultAnimation.ReplaceAnim("idle");