Made Move::NotifyBlocker handle traits appropriately
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user