Fix world visibility checks when shroud is disabled.

This commit is contained in:
Paul Chote
2013-08-08 13:04:01 +12:00
parent 8271e5ed63
commit 8fcbe7bb9e
2 changed files with 5 additions and 2 deletions

View File

@@ -84,6 +84,7 @@ namespace OpenRA.Traits
case "DevShroudDisable":
{
DisableShroud ^= true;
self.Owner.Shroud.Disabled = DisableShroud;
if (self.World.LocalPlayer == self.Owner)
self.World.RenderPlayer = DisableShroud ? null : self.Owner;
break;

View File

@@ -23,6 +23,8 @@ namespace OpenRA.Traits
public class Shroud
{
[Sync] public bool Disabled = false;
Actor self;
Map map;
@@ -248,7 +250,7 @@ namespace OpenRA.Traits
if (!map.IsInMap(x, y))
return false;
if (!self.World.LobbyInfo.GlobalSettings.Shroud)
if (Disabled || !self.World.LobbyInfo.GlobalSettings.Shroud)
return true;
return explored[x, y] && (generatedShroudCount[x, y] == 0 || visibleCount[x, y] > 0);
@@ -267,7 +269,7 @@ namespace OpenRA.Traits
if (x < 0 || x >= map.MapSize.X || y < 0 || y >= map.MapSize.Y)
return false;
if (!self.World.LobbyInfo.GlobalSettings.Fog)
if (Disabled || !self.World.LobbyInfo.GlobalSettings.Fog)
return true;
return visibleCount[x, y] > 0;