Ability for BF to have idle and notes alt anims + failsafe

This commit is contained in:
Spel0
2021-08-13 19:36:56 +03:00
parent c2db786457
commit 91a6b772ff
3 changed files with 19 additions and 13 deletions

View File

@ -483,6 +483,15 @@ class Character extends FlxSprite
public function playAnim(AnimName:String, Force:Bool = false, Reversed:Bool = false, Frame:Int = 0):Void
{
if (AnimName.endsWith('alt') && animation.getByName(AnimName) == null)
{
#if debug
FlxG.log.warn(['Such alt animation doesnt exist: ' + AnimName]);
#end
AnimName = AnimName.split('-')[0];
}
animation.play(AnimName, Force, Reversed, Frame);
var daOffset = animOffsets.get(AnimName);