Made Move::NotifyBlocker handle traits appropriately

This commit is contained in:
Ian T. Jacobsen
2014-02-05 02:18:12 +00:00
parent 91908c560d
commit 3c80024113
2 changed files with 3 additions and 6 deletions

View File

@@ -545,7 +545,8 @@ namespace OpenRA.Mods.RA.Move
public void OnNotifyBlockingMove(Actor self, Actor blocking) public void OnNotifyBlockingMove(Actor self, Actor blocking)
{ {
Nudge(self, blocking, true); if (self.IsIdle && self.AppearsFriendlyTo(blocking))
Nudge(self, blocking, true);
} }
} }
} }

View File

@@ -175,12 +175,8 @@ namespace OpenRA.Mods.RA.Move
{ {
foreach (var blocker in self.World.ActorMap.GetUnitsAt(nextCell)) foreach (var blocker in self.World.ActorMap.GetUnitsAt(nextCell))
{ {
Log.Write("debug", "NotifyBlocker #{0} nudges #{1} at {2} from {3}",
self.ActorID, blocker.ActorID, nextCell, self.Location);
// Notify the blocker that he's blocking our move: // Notify the blocker that he's blocking our move:
var moveBlocked = blocker.TraitOrDefault<INotifyBlockingMove>(); foreach (var moveBlocked in blocker.TraitsImplementing<INotifyBlockingMove>())
if (moveBlocked != null)
moveBlocked.OnNotifyBlockingMove(blocker, self); moveBlocked.OnNotifyBlockingMove(blocker, self);
} }
} }