From a6c58c0f68f71764dbf9894a27f73576f73e4921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Tue, 13 Jan 2026 20:47:20 +0100 Subject: [PATCH] Check if the minelayer is destroyed. --- OpenRA.Mods.Common/Activities/LayMines.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Activities/LayMines.cs b/OpenRA.Mods.Common/Activities/LayMines.cs index 4c1cb5cf69..839699c1bd 100644 --- a/OpenRA.Mods.Common/Activities/LayMines.cs +++ b/OpenRA.Mods.Common/Activities/LayMines.cs @@ -174,10 +174,13 @@ namespace OpenRA.Mods.Common.Activities yield return new TargetLineNode(Target.FromCell(self.World, c), minelayer.Info.TargetLineColor, tile: minelayer.Tile); } - static bool CanLayMine(Actor self, CPos p) + static bool CanLayMine(Actor self, CPos location) { + if (self.IsDead || !self.IsInWorld) + return false; + // If there is no unit (other than me) here, we can place a mine here - return self.World.ActorMap.GetActorsAt(p).All(a => a == self); + return self.World.ActorMap.GetActorsAt(location).All(a => a == self); } bool StartLayingMine(Actor self)