From 5e220a9ac73241881fb125a66e590e8efde09f72 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 21 Jun 2011 19:55:43 +1200 Subject: [PATCH] Fix #306 --- OpenRA.Game/Traits/World/ResourceLayer.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenRA.Game/Traits/World/ResourceLayer.cs b/OpenRA.Game/Traits/World/ResourceLayer.cs index 9c004f7251..c8b573c87d 100644 --- a/OpenRA.Game/Traits/World/ResourceLayer.cs +++ b/OpenRA.Game/Traits/World/ResourceLayer.cs @@ -146,6 +146,10 @@ namespace OpenRA.Traits public void Destroy(int2 p) { + // Don't break other users of CustomTerrain if there are no resources + if (content[p.X, p.Y].type == null) + return; + content[p.X, p.Y].type = null; content[p.X, p.Y].image = null; content[p.X, p.Y].density = 0;