Don't try to play a rearming animation if it doesn't exist

This commit is contained in:
Pavel Penev
2015-09-03 15:13:54 +03:00
parent 119023c485
commit 27e16d0730

View File

@@ -56,7 +56,9 @@ namespace OpenRA.Mods.Common.Activities
if (!pool.GiveAmmo())
continue;
hostBuilding.Trait<WithSpriteBody>().PlayCustomAnimation(hostBuilding, "active");
var wsb = hostBuilding.Trait<WithSpriteBody>();
if (wsb.DefaultAnimation.HasSequence("active"))
wsb.PlayCustomAnimation(hostBuilding, "active");
var sound = pool.Info.RearmSound;
if (sound != null)