Render shellmap / don't assume Game.Localplayer exists
This commit is contained in:
@@ -88,7 +88,7 @@ namespace OpenRA.Graphics
|
||||
if (firstRow < 0) firstRow = 0;
|
||||
if (lastRow > map.Height) lastRow = map.Height;
|
||||
|
||||
if (!Game.world.LocalPlayer.Shroud.Disabled && Game.world.LocalPlayer.Shroud.bounds.HasValue)
|
||||
if (Game.world.LocalPlayer != null && !Game.world.LocalPlayer.Shroud.Disabled && Game.world.LocalPlayer.Shroud.bounds.HasValue)
|
||||
{
|
||||
var r = Game.world.LocalPlayer.Shroud.bounds.Value;
|
||||
if (firstRow < r.Top - map.YOffset)
|
||||
|
||||
@@ -72,12 +72,10 @@ namespace OpenRA.Graphics
|
||||
float2 r2 = new float2(-1, 1);
|
||||
|
||||
renderer.BeginFrame(r1, r2, scrollPosition.ToInt2());
|
||||
|
||||
world.WorldRenderer.Draw();
|
||||
if( Game.orderManager.GameStarted )
|
||||
{
|
||||
world.WorldRenderer.Draw();
|
||||
Game.chrome.Draw( world );
|
||||
|
||||
Game.chrome.Draw( world );
|
||||
|
||||
if( Game.orderManager.Connection.ConnectionState == ConnectionState.NotConnected )
|
||||
Game.chrome.DrawDialog("Connection lost.");
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace OpenRA.Graphics
|
||||
|
||||
Rectangle GetBoundsRect()
|
||||
{
|
||||
if (!world.LocalPlayer.Shroud.Disabled && world.LocalPlayer.Shroud.bounds.HasValue)
|
||||
if (world.LocalPlayer != null && !world.LocalPlayer.Shroud.Disabled && world.LocalPlayer.Shroud.bounds.HasValue)
|
||||
{
|
||||
var r = world.LocalPlayer.Shroud.bounds.Value;
|
||||
|
||||
@@ -136,7 +136,8 @@ namespace OpenRA.Graphics
|
||||
if (Game.controller.orderGenerator != null)
|
||||
Game.controller.orderGenerator.Render(world);
|
||||
|
||||
world.LocalPlayer.Shroud.Draw(spriteRenderer);
|
||||
if (world.LocalPlayer != null)
|
||||
world.LocalPlayer.Shroud.Draw(spriteRenderer);
|
||||
|
||||
spriteRenderer.Flush();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user