Replace IDisableMove with upgradability

This commit is contained in:
atlimit8
2015-09-25 16:55:33 -05:00
parent 0fc04b7a4a
commit c827dbe183
23 changed files with 82 additions and 77 deletions

View File

@@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Activities
{
readonly IPositionable positionable;
readonly IMove movement;
readonly IDisableMove[] moveDisablers;
readonly IDisabledTrait disableable;
WPos start, end;
int length;
int ticks = 0;
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Activities
{
positionable = self.Trait<IPositionable>();
movement = self.TraitOrDefault<IMove>();
moveDisablers = self.TraitsImplementing<IDisableMove>().ToArray();
disableable = movement as IDisabledTrait;
this.start = start;
this.end = end;
this.length = length;
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Activities
public override Activity Tick(Actor self)
{
if (moveDisablers.Any(d => d.MoveDisabled(self)))
if (disableable != null && disableable.IsTraitDisabled)
return this;
var pos = length > 1