HasSight -> RevealsShroud and used everywhere
This commit is contained in:
@@ -82,7 +82,7 @@
|
||||
<Compile Include="Orders\GenericSelectTarget.cs" />
|
||||
<Compile Include="Traits\AI\EmitInfantryOnSell.cs" />
|
||||
<Compile Include="Traits\AI\ReturnOnIdle.cs" />
|
||||
<Compile Include="Traits\HasSight.cs" />
|
||||
<Compile Include="Traits\RevealsShroud.cs" />
|
||||
<Compile Include="Traits\Player\VictoryConditions.cs" />
|
||||
<Compile Include="Traits\Modifiers\HiddenUnderFog.cs" />
|
||||
<Compile Include="Traits\Render\RenderFlare.cs" />
|
||||
|
||||
@@ -53,7 +53,6 @@ namespace OpenRA.Traits
|
||||
{
|
||||
self.World.WorldActor.traits.Get<UnitInfluence>().Remove(self, this);
|
||||
self.Location = value;
|
||||
self.World.WorldActor.traits.Get<Shroud>().UpdateActor(self);
|
||||
}
|
||||
self.World.WorldActor.traits.Get<UnitInfluence>().Add(self, this);
|
||||
}
|
||||
|
||||
@@ -20,16 +20,19 @@
|
||||
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
class HasSightInfo : TraitInfo<HasSight> { }
|
||||
class RevealsShroudInfo : TraitInfo<RevealsShroud> { }
|
||||
|
||||
// for random non-mobile movers
|
||||
|
||||
class HasSight : ITick
|
||||
class RevealsShroud : ITick
|
||||
{
|
||||
int2 previousLocation;
|
||||
|
||||
public void Tick(Actor self)
|
||||
{
|
||||
if (!self.IsIdle)
|
||||
if (!self.IsIdle && previousLocation != self.Location)
|
||||
{
|
||||
previousLocation = self.Location;
|
||||
self.World.WorldActor.traits.Get<Shroud>().UpdateActor(self);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,6 +87,8 @@ namespace OpenRA.Traits
|
||||
vis = GetVisOrigins(a).ToArray()
|
||||
};
|
||||
|
||||
if (v.range == 0) return; // don't bother for things that can't see
|
||||
|
||||
foreach (var p in v.vis)
|
||||
{
|
||||
foreach (var q in FindVisibleTiles(a.World, p, v.range))
|
||||
|
||||
Reference in New Issue
Block a user