Fix world visibility checks when shroud is disabled.
This commit is contained in:
@@ -84,6 +84,7 @@ namespace OpenRA.Traits
|
|||||||
case "DevShroudDisable":
|
case "DevShroudDisable":
|
||||||
{
|
{
|
||||||
DisableShroud ^= true;
|
DisableShroud ^= true;
|
||||||
|
self.Owner.Shroud.Disabled = DisableShroud;
|
||||||
if (self.World.LocalPlayer == self.Owner)
|
if (self.World.LocalPlayer == self.Owner)
|
||||||
self.World.RenderPlayer = DisableShroud ? null : self.Owner;
|
self.World.RenderPlayer = DisableShroud ? null : self.Owner;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ namespace OpenRA.Traits
|
|||||||
|
|
||||||
public class Shroud
|
public class Shroud
|
||||||
{
|
{
|
||||||
|
[Sync] public bool Disabled = false;
|
||||||
|
|
||||||
Actor self;
|
Actor self;
|
||||||
Map map;
|
Map map;
|
||||||
|
|
||||||
@@ -248,7 +250,7 @@ namespace OpenRA.Traits
|
|||||||
if (!map.IsInMap(x, y))
|
if (!map.IsInMap(x, y))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!self.World.LobbyInfo.GlobalSettings.Shroud)
|
if (Disabled || !self.World.LobbyInfo.GlobalSettings.Shroud)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return explored[x, y] && (generatedShroudCount[x, y] == 0 || visibleCount[x, y] > 0);
|
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)
|
if (x < 0 || x >= map.MapSize.X || y < 0 || y >= map.MapSize.Y)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!self.World.LobbyInfo.GlobalSettings.Fog)
|
if (Disabled || !self.World.LobbyInfo.GlobalSettings.Fog)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return visibleCount[x, y] > 0;
|
return visibleCount[x, y] > 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user