Fixes TerrainRenderer.Draw() causing a crash because of negative firstRow value

This commit is contained in:
Scott_NZ
2013-04-19 19:09:29 +12:00
parent 1db4cb1867
commit 2c4c7aa4c0

View File

@@ -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(