From 0a7ffc8cc94cf8f0104b1071ed9684c27d0e107d Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 2 Jan 2010 00:42:37 -0800 Subject: [PATCH] Fix deploying a mine on a mine making the game explode --- OpenRa.Game/Traits/Minelayer.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenRa.Game/Traits/Minelayer.cs b/OpenRa.Game/Traits/Minelayer.cs index 35b9f97e65..053c7d0d8c 100644 --- a/OpenRa.Game/Traits/Minelayer.cs +++ b/OpenRa.Game/Traits/Minelayer.cs @@ -14,6 +14,10 @@ namespace OpenRa.Game.Traits var limitedAmmo = self.traits.GetOrDefault(); if (limitedAmmo != null && !limitedAmmo.HasAmmo()) return null; + + // Ensure that the cell is empty except for the minelayer + if (Game.UnitInfluence.GetUnitsAt( xy ).Any(a => a != self)) + return null; if (mi.Button == MouseButton.Right && underCursor == self) return new Order("Deploy", self, null, int2.Zero, null);