@@ -282,7 +282,7 @@ namespace OpenRA.Traits
|
|||||||
return explored.Contains(uv) && explored[uv] && (generatedShroudCount[uv] == 0 || visibleCount[uv] > 0);
|
return explored.Contains(uv) && explored[uv] && (generatedShroudCount[uv] == 0 || visibleCount[uv] > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShroudEnabled { get { return !Disabled && self.World.LobbyInfo.GlobalSettings.Shroud; } }
|
public bool ShroudEnabled { get { return !Disabled && self.World.LobbyInfo.GlobalSettings.Shroud; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a fast exploration lookup that skips the usual validation.
|
/// Returns a fast exploration lookup that skips the usual validation.
|
||||||
@@ -329,7 +329,7 @@ namespace OpenRA.Traits
|
|||||||
return visibleCount.Contains(uv) && visibleCount[uv] > 0;
|
return visibleCount.Contains(uv) && visibleCount[uv] > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FogEnabled { get { return !Disabled && self.World.LobbyInfo.GlobalSettings.Fog; } }
|
public bool FogEnabled { get { return !Disabled && self.World.LobbyInfo.GlobalSettings.Fog; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a fast visibility lookup that skips the usual validation.
|
/// Returns a fast visibility lookup that skips the usual validation.
|
||||||
|
|||||||
@@ -237,18 +237,18 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
currentShroud.CellsChanged -= DirtyCells;
|
currentShroud.CellsChanged -= DirtyCells;
|
||||||
|
|
||||||
if (shroud != null)
|
if (shroud != null)
|
||||||
{
|
|
||||||
shroud.CellsChanged += DirtyCells;
|
shroud.CellsChanged += DirtyCells;
|
||||||
|
|
||||||
// Needs the anonymous function to ensure the correct overload is chosen
|
// Needs the anonymous function to ensure the correct overload is chosen
|
||||||
visibleUnderShroud = uv => currentShroud.IsExplored(uv);
|
if (shroud != null && shroud.ShroudEnabled)
|
||||||
visibleUnderFog = uv => currentShroud.IsVisible(uv);
|
visibleUnderShroud = puv => currentShroud.IsExplored(puv);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
visibleUnderShroud = puv => map.Contains(puv);
|
visibleUnderShroud = puv => map.Contains(puv);
|
||||||
|
|
||||||
|
if (shroud != null && shroud.FogEnabled)
|
||||||
|
visibleUnderFog = puv => currentShroud.IsVisible(puv);
|
||||||
|
else
|
||||||
visibleUnderFog = puv => map.Contains(puv);
|
visibleUnderFog = puv => map.Contains(puv);
|
||||||
}
|
|
||||||
|
|
||||||
currentShroud = shroud;
|
currentShroud = shroud;
|
||||||
DirtyCells(map.ProjectedCellBounds);
|
DirtyCells(map.ProjectedCellBounds);
|
||||||
|
|||||||
Reference in New Issue
Block a user