Fix NRE in SmudgeLayer.AddSmudge

This commit is contained in:
Oliver Brakmann
2016-08-30 18:45:22 +02:00
parent b999d88905
commit 0ebf2d00b0

View File

@@ -151,7 +151,7 @@ namespace OpenRA.Mods.Common.Traits
else
{
// Existing smudge; make it deeper
var tile = dirty.ContainsKey(loc) ? dirty[loc] : tiles[loc];
var tile = dirty.ContainsKey(loc) && dirty[loc].Sprite != null ? dirty[loc] : tiles[loc];
var maxDepth = smudges[tile.Type].Length;
if (tile.Depth < maxDepth - 1)
{