diff --git a/OpenRA.Game/Traits/Activities/Move.cs b/OpenRA.Game/Traits/Activities/Move.cs index dfa7534715..9d2fe99d26 100755 --- a/OpenRA.Game/Traits/Activities/Move.cs +++ b/OpenRA.Game/Traits/Activities/Move.cs @@ -161,7 +161,7 @@ namespace OpenRA.Traits.Activities var nudge = blocker.traits.GetOrDefault(); if (nudge != null) - nudge.OnNudge(blocker); + nudge.OnNudge(blocker, self); } int2? PopPath( Actor self, Mobile mobile ) diff --git a/OpenRA.Game/Traits/Mobile.cs b/OpenRA.Game/Traits/Mobile.cs index 397ad9c02f..6431b6f083 100644 --- a/OpenRA.Game/Traits/Mobile.cs +++ b/OpenRA.Game/Traits/Mobile.cs @@ -25,7 +25,7 @@ namespace OpenRA.Traits public virtual object Create(ActorInitializer init) { return new Mobile(init, this); } } - public class Mobile : IIssueOrder, IResolveOrder, IOccupySpace, IMove, IProvideCursor + public class Mobile : IIssueOrder, IResolveOrder, IOccupySpace, IMove, IProvideCursor, INudge { public readonly Actor self; public readonly MobileInfo Info; @@ -240,5 +240,14 @@ namespace OpenRA.Traits { self.World.WorldActor.traits.Get().Remove( self, this ); } + + public void OnNudge(Actor self, Actor nudger) + { + if (self.Owner.Stances[nudger.Owner] != Stance.Ally) + return; /* don't allow ourselves to be pushed around + * by the enemy! */ + + + } } } diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index 2090824a3c..19770642b4 100644 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -53,7 +53,7 @@ namespace OpenRA.Traits public interface IDisable { bool Disabled { get; } } public interface IExplodeModifier { bool ShouldExplode(Actor self); } - public interface INudge { void OnNudge(Actor self); } + public interface INudge { void OnNudge(Actor self, Actor nudger); } public interface IOccupySpace {