Skip shroud/fog calculations when both are disabled via lobby option.
This commit is contained in:
@@ -15,21 +15,27 @@ namespace OpenRA.Traits
|
||||
public class RevealsShroudInfo : ITraitInfo
|
||||
{
|
||||
public readonly WRange Range = WRange.Zero;
|
||||
public object Create(ActorInitializer init) { return new RevealsShroud(this); }
|
||||
|
||||
public object Create(ActorInitializer init) { return new RevealsShroud(init.Self, this); }
|
||||
}
|
||||
|
||||
public class RevealsShroud : ITick, ISync
|
||||
{
|
||||
readonly RevealsShroudInfo info;
|
||||
readonly bool lobbyShroudFogDisabled;
|
||||
[Sync] CPos cachedLocation;
|
||||
|
||||
public RevealsShroud(RevealsShroudInfo info)
|
||||
public RevealsShroud(Actor self, RevealsShroudInfo info)
|
||||
{
|
||||
this.info = info;
|
||||
lobbyShroudFogDisabled = !self.World.LobbyInfo.GlobalSettings.Shroud && !self.World.LobbyInfo.GlobalSettings.Fog;
|
||||
}
|
||||
|
||||
public void Tick(Actor self)
|
||||
{
|
||||
if (lobbyShroudFogDisabled)
|
||||
return;
|
||||
|
||||
if (cachedLocation != self.Location)
|
||||
{
|
||||
cachedLocation = self.Location;
|
||||
|
||||
Reference in New Issue
Block a user