Fix variable naming in Locomotor.
This commit is contained in:
@@ -336,14 +336,14 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
return world.ActorMap.FreeSubCell(cell, preferredSubCell);
|
return world.ActorMap.FreeSubCell(cell, preferredSubCell);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsBlockedBy(Actor self, Actor otherActor, Actor ignoreActor, BlockedByActor check, CellFlag cellFlag)
|
bool IsBlockedBy(Actor actor, Actor otherActor, Actor ignoreActor, BlockedByActor check, CellFlag cellFlag)
|
||||||
{
|
{
|
||||||
if (otherActor == ignoreActor)
|
if (otherActor == ignoreActor)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// If the check allows: We are not blocked by units that we can force to move out of the way.
|
// If the check allows: We are not blocked by units that we can force to move out of the way.
|
||||||
if (check <= BlockedByActor.Immovable && cellFlag.HasCellFlag(CellFlag.HasMovableActor) &&
|
if (check <= BlockedByActor.Immovable && cellFlag.HasCellFlag(CellFlag.HasMovableActor) &&
|
||||||
self.Owner.Stances[otherActor.Owner] == Stance.Ally)
|
actor.Owner.Stances[otherActor.Owner] == Stance.Ally)
|
||||||
{
|
{
|
||||||
var mobile = otherActor.TraitOrDefault<Mobile>();
|
var mobile = otherActor.TraitOrDefault<Mobile>();
|
||||||
if (mobile != null && !mobile.IsTraitDisabled && !mobile.IsTraitPaused && !mobile.IsImmovable)
|
if (mobile != null && !mobile.IsTraitDisabled && !mobile.IsTraitPaused && !mobile.IsImmovable)
|
||||||
@@ -352,14 +352,14 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
// If the check allows: we are not blocked by moving units.
|
// If the check allows: we are not blocked by moving units.
|
||||||
if (check <= BlockedByActor.Stationary && cellFlag.HasCellFlag(CellFlag.HasMovingActor) &&
|
if (check <= BlockedByActor.Stationary && cellFlag.HasCellFlag(CellFlag.HasMovingActor) &&
|
||||||
IsMoving(self, otherActor))
|
IsMoving(actor, otherActor))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (cellFlag.HasCellFlag(CellFlag.HasTemporaryBlocker))
|
if (cellFlag.HasCellFlag(CellFlag.HasTemporaryBlocker))
|
||||||
{
|
{
|
||||||
// If there is a temporary blocker in our path, but we can remove it, we are not blocked.
|
// If there is a temporary blocker in our path, but we can remove it, we are not blocked.
|
||||||
var temporaryBlocker = otherActor.TraitOrDefault<ITemporaryBlocker>();
|
var temporaryBlocker = otherActor.TraitOrDefault<ITemporaryBlocker>();
|
||||||
if (temporaryBlocker != null && temporaryBlocker.CanRemoveBlockage(otherActor, self))
|
if (temporaryBlocker != null && temporaryBlocker.CanRemoveBlockage(otherActor, actor))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
// PERF: Avoid LINQ.
|
// PERF: Avoid LINQ.
|
||||||
var crushables = otherActor.TraitsImplementing<ICrushable>();
|
var crushables = otherActor.TraitsImplementing<ICrushable>();
|
||||||
foreach (var crushable in crushables)
|
foreach (var crushable in crushables)
|
||||||
if (crushable.CrushableBy(otherActor, self, Info.Crushes))
|
if (crushable.CrushableBy(otherActor, actor, Info.Crushes))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user