Merge pull request #8663 from Mailaender/disguise-stand2-crash

Fixed a crash when disguising the spy as infantry without stand2
This commit is contained in:
abcdefg30
2015-07-13 13:39:19 +02:00
3 changed files with 22 additions and 6 deletions

View File

@@ -39,7 +39,9 @@ namespace OpenRA.Mods.RA.Traits
if (disguise.AsSprite != intendedSprite)
{
intendedSprite = disguise.AsSprite;
DefaultAnimation.ChangeImage(intendedSprite ?? rs.GetImage(self), info.StandSequences.Random(Game.CosmeticRandom));
var sequence = DefaultAnimation.GetRandomExistingSequence(info.StandSequences, Game.CosmeticRandom);
if (sequence != null)
DefaultAnimation.ChangeImage(intendedSprite ?? rs.GetImage(self), sequence);
rs.UpdatePalette();
}