Replace SequenceActivities with ChildActivity in several activities.
This commit is contained in:
@@ -91,6 +91,13 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
if (ChildActivity != null)
|
||||
{
|
||||
ChildActivity = ActivityUtils.RunActivity(self, ChildActivity);
|
||||
if (ChildActivity != null)
|
||||
return this;
|
||||
}
|
||||
|
||||
if (IsCanceling || !attack.CanAttack(self, target))
|
||||
return NextActivity;
|
||||
|
||||
@@ -103,7 +110,9 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
if (!string.IsNullOrEmpty(attack.info.ChargeAudio))
|
||||
Game.Sound.Play(SoundType.World, attack.info.ChargeAudio, self.CenterPosition);
|
||||
|
||||
return ActivityUtils.SequenceActivities(self, new Wait(attack.info.InitialChargeDelay), new ChargeFire(attack, target), this);
|
||||
QueueChild(self, new Wait(attack.info.InitialChargeDelay), true);
|
||||
QueueChild(self, new ChargeFire(attack, target));
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,6 +129,13 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
if (ChildActivity != null)
|
||||
{
|
||||
ChildActivity = ActivityUtils.RunActivity(self, ChildActivity);
|
||||
if (ChildActivity != null)
|
||||
return this;
|
||||
}
|
||||
|
||||
if (IsCanceling || !attack.CanAttack(self, target))
|
||||
return NextActivity;
|
||||
|
||||
@@ -128,7 +144,8 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
attack.DoAttack(self, target);
|
||||
|
||||
return ActivityUtils.SequenceActivities(self, new Wait(attack.info.ChargeDelay), this);
|
||||
QueueChild(self, new Wait(attack.info.ChargeDelay), true);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user