Make sure silo animation is properly updated on owner change

This commit is contained in:
reaperrr
2015-09-14 18:30:15 +02:00
parent 522e7d5d04
commit 59a96ab0ef

View File

@@ -51,6 +51,11 @@ namespace OpenRA.Mods.Common.Traits
public void OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
{
playerResources = newOwner.PlayerActor.Trait<PlayerResources>();
wsb.DefaultAnimation.PlayFetchIndex(wsb.NormalizeSequence(self, info.Sequence),
() => playerResources.ResourceCapacity != 0
? ((info.Stages * wsb.DefaultAnimation.CurrentSequence.Length - 1) * playerResources.Resources) / (info.Stages * playerResources.ResourceCapacity)
: 0);
}
}
}