Fix target lines still being visible after an owner change

This commit is contained in:
abcdefg30
2018-10-27 21:13:39 +02:00
committed by reaperrr
parent 8b8a14e0b8
commit d46e47d16d

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
public virtual object Create(ActorInitializer init) { return new DrawLineToTarget(init.Self, this); } public virtual object Create(ActorInitializer init) { return new DrawLineToTarget(init.Self, this); }
} }
public class DrawLineToTarget : IRenderAboveShroudWhenSelected, INotifySelected, INotifyBecomingIdle public class DrawLineToTarget : IRenderAboveShroudWhenSelected, INotifySelected, INotifyBecomingIdle, INotifyOwnerChanged
{ {
readonly DrawLineToTargetInfo info; readonly DrawLineToTargetInfo info;
List<Target> targets; List<Target> targets;
@@ -89,6 +89,11 @@ namespace OpenRA.Mods.Common.Traits
{ {
targets = null; targets = null;
} }
void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
{
targets = null;
}
} }
public static class LineTargetExts public static class LineTargetExts