diff --git a/OpenRA.Game/Graphics/TerrainRenderer.cs b/OpenRA.Game/Graphics/TerrainRenderer.cs index 08882935e3..3231ef4347 100644 --- a/OpenRA.Game/Graphics/TerrainRenderer.cs +++ b/OpenRA.Game/Graphics/TerrainRenderer.cs @@ -69,9 +69,6 @@ namespace OpenRA.Graphics if (lastRow < 0 || firstRow > map.Bounds.Height) return; - if (firstRow < 0) firstRow = 0; - if (lastRow > map.Bounds.Height) lastRow = map.Bounds.Height; - if (world.VisibleBounds.HasValue) { var r = world.VisibleBounds.Value; @@ -82,6 +79,9 @@ namespace OpenRA.Graphics firstRow = r.Bottom - map.Bounds.Top; } + if (firstRow < 0) firstRow = 0; + if (lastRow > map.Bounds.Height) lastRow = map.Bounds.Height; + if( lastRow < firstRow ) lastRow = firstRow; Game.Renderer.WorldSpriteRenderer.DrawVertexBuffer(