Changed most references of trait Mobile -> IMove.
In Mobile.cs IsMoving now has a public set as opposed to the initial internal. Added IMoveInfo interface to go with *Info classes that require IMove. WithRotor now uses IMove.IsMoving instead of (self.CenterPosition.Z > 0) as part of a check.
This commit is contained in:
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA.Move
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
var positionable = self.Trait<IPositionable>();
|
||||
var mobile = positionable as Mobile;
|
||||
var movement = self.Trait<IMove>();
|
||||
|
||||
var pos = length > 1
|
||||
? WPos.Lerp(start, end, ticks, length - 1)
|
||||
@@ -38,14 +38,14 @@ namespace OpenRA.Mods.RA.Move
|
||||
positionable.SetVisualPosition(self, pos);
|
||||
if (++ticks >= length)
|
||||
{
|
||||
if (mobile != null)
|
||||
mobile.IsMoving = false;
|
||||
if (movement != null)
|
||||
movement.IsMoving = false;
|
||||
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
if (mobile != null)
|
||||
mobile.IsMoving = true;
|
||||
if (movement != null)
|
||||
movement.IsMoving = true;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user