Fix target lines still being visible after an owner change
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user