Refactor AutoTarget scan and GPS interaction, and cache trait lookup for a slight performance boost
This commit is contained in:
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA
|
||||
public object Create (ActorInitializer init) { return new GpsWatcher(init.self.Owner); }
|
||||
}
|
||||
|
||||
class GpsWatcher : ISync
|
||||
class GpsWatcher : ISync, IFogVisibilityModifier
|
||||
{
|
||||
[Sync] bool Launched = false;
|
||||
[Sync] public bool GrantedAllies = false;
|
||||
@@ -73,6 +73,11 @@ namespace OpenRA.Mods.RA
|
||||
if (Granted || GrantedAllies)
|
||||
owner.Shroud.ExploreAll(owner.World);
|
||||
}
|
||||
|
||||
public bool HasFogVisibility(Player byPlayer)
|
||||
{
|
||||
return Granted || GrantedAllies;
|
||||
}
|
||||
}
|
||||
|
||||
class GpsPowerInfo : SupportPowerInfo
|
||||
|
||||
Reference in New Issue
Block a user