Fixes infantry sequence modifier for good
This commit is contained in:
@@ -48,16 +48,16 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WithInfantryBody : UpgradableTrait<WithInfantryBodyInfo>, ITick, INotifyAttack, INotifyIdle
|
public class WithInfantryBody : UpgradableTrait<WithInfantryBodyInfo>, ITick, INotifyAttack, INotifyIdle, INotifyCreated
|
||||||
{
|
{
|
||||||
readonly IMove move;
|
readonly IMove move;
|
||||||
readonly IRenderInfantrySequenceModifier rsm;
|
|
||||||
protected readonly Animation DefaultAnimation;
|
protected readonly Animation DefaultAnimation;
|
||||||
|
|
||||||
bool dirty;
|
bool dirty;
|
||||||
string idleSequence;
|
string idleSequence;
|
||||||
int idleDelay;
|
int idleDelay;
|
||||||
AnimationState state;
|
AnimationState state;
|
||||||
|
IRenderInfantrySequenceModifier rsm;
|
||||||
|
|
||||||
bool IsModifyingSequence { get { return rsm != null && rsm.IsModifyingSequence; } }
|
bool IsModifyingSequence { get { return rsm != null && rsm.IsModifyingSequence; } }
|
||||||
bool wasModifying;
|
bool wasModifying;
|
||||||
@@ -74,7 +74,11 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
DefaultAnimation.PlayFetchIndex(NormalizeInfantrySequence(init.Self, info.StandSequences.Random(Game.CosmeticRandom)), () => 0);
|
DefaultAnimation.PlayFetchIndex(NormalizeInfantrySequence(init.Self, info.StandSequences.Random(Game.CosmeticRandom)), () => 0);
|
||||||
state = AnimationState.Waiting;
|
state = AnimationState.Waiting;
|
||||||
move = init.Self.Trait<IMove>();
|
move = init.Self.Trait<IMove>();
|
||||||
rsm = init.Self.TraitOrDefault<IRenderInfantrySequenceModifier>();
|
}
|
||||||
|
|
||||||
|
public void Created(Actor self)
|
||||||
|
{
|
||||||
|
rsm = self.TraitOrDefault<IRenderInfantrySequenceModifier>();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual string NormalizeInfantrySequence(Actor self, string baseSequence)
|
protected virtual string NormalizeInfantrySequence(Actor self, string baseSequence)
|
||||||
|
|||||||
Reference in New Issue
Block a user