Render shellmap / don't assume Game.Localplayer exists

This commit is contained in:
Paul Chote
2010-04-09 20:11:29 +12:00
parent 36a6123dd2
commit 1078fc380a
6 changed files with 10 additions and 14 deletions

View File

@@ -83,7 +83,6 @@ namespace OpenRA.Traits
public void Render()
{
var shroud = world.LocalPlayer.Shroud;
var tl = world.Map.TopLeft;
var br = world.Map.BottomRight;
@@ -91,8 +90,8 @@ namespace OpenRA.Traits
for (int y = tl.Y; y < br.Y; y++)
{
var t = new int2(x, y);
if (!shroud.IsExplored(t) || tiles[x,y].type == 0) continue;
if (world.LocalPlayer != null && !world.LocalPlayer.Shroud.IsExplored(t) || tiles[x,y].type == 0) continue;
spriteRenderer.DrawSprite(smudgeSprites[tiles[x,y].type- 1][tiles[x,y].image],
Game.CellSize * (float2)t, "terrain");
}