Fix a NRE in TerrainSpriteLayer.

This commit is contained in:
Paul Chote
2015-07-05 14:30:23 +01:00
parent 7c0d3f4e40
commit 971d1c1388

View File

@@ -69,7 +69,8 @@ namespace OpenRA.Graphics
public void Update(CPos cell, Sprite sprite)
{
var pos = worldRenderer.ScreenPosition(map.CenterOfCell(cell)) + sprite.Offset - 0.5f * sprite.Size;
var pos = sprite == null ? float2.Zero :
worldRenderer.ScreenPosition(map.CenterOfCell(cell)) + sprite.Offset - 0.5f * sprite.Size;
Update(cell.ToMPos(map.TileShape), sprite, pos);
}