Simplify and increase robustness of Shroud et al. Fixes #3440.

This commit is contained in:
Paul Chote
2013-06-21 19:54:25 +12:00
parent 574ab7281b
commit 7bce2017c3
6 changed files with 138 additions and 207 deletions

View File

@@ -66,8 +66,6 @@ namespace OpenRA
}
}
public Shroud.ActorVisibility Sight;
[Sync] public Player Owner;
Activity currentActivity;
@@ -107,15 +105,6 @@ namespace OpenRA
return TraitsImplementing<IAutoSelectionSize>().Select(x => x.SelectionSize(this)).FirstOrDefault();
});
if (this.HasTrait<RevealsShroud>())
{
Sight = new Shroud.ActorVisibility
{
range = this.Trait<RevealsShroud>().RevealRange,
vis = Shroud.GetVisOrigins(this).ToArray()
};
}
ApplyIRender = (x, wr) => x.Render(this, wr);
ApplyRenderModifier = (m, p, wr) => p.ModifyRender(this, wr, m);
@@ -131,11 +120,6 @@ namespace OpenRA
currentActivity = Traits.Util.RunActivity(this, currentActivity);
}
public void UpdateSight()
{
Sight.vis = Shroud.GetVisOrigins(this).ToArray();
}
public bool IsIdle
{
get { return currentActivity == null; }