Update FrozenActor TargetTypes alongside other variable state.

This commit is contained in:
Paul Chote
2017-12-10 16:57:16 +00:00
committed by abcdefg30
parent b9e03ac009
commit 9dc330b300

View File

@@ -31,11 +31,11 @@ namespace OpenRA.Traits
{
public readonly PPos[] Footprint;
public readonly WPos CenterPosition;
public readonly HashSet<string> TargetTypes;
readonly Actor actor;
readonly Shroud shroud;
public Player Owner { get; private set; }
public HashSet<string> TargetTypes { get; private set; }
public ITooltipInfo TooltipInfo { get; private set; }
public Player TooltipOwner { get; private set; }
@@ -82,7 +82,7 @@ namespace OpenRA.Traits
footprint.Select(p => shroud.Contains(p).ToString()).JoinWith("|")));
CenterPosition = self.CenterPosition;
TargetTypes = self.GetEnabledTargetTypes().ToHashSet();
TargetTypes = new HashSet<string>();
tooltips = self.TraitsImplementing<ITooltip>().ToArray();
health = self.TraitOrDefault<IHealth>();
@@ -98,6 +98,7 @@ namespace OpenRA.Traits
public void RefreshState()
{
Owner = actor.Owner;
TargetTypes = actor.GetEnabledTargetTypes().ToHashSet();
if (health != null)
{