Skip to content

Commit

Permalink
Resloved issue where linked cels are used
Browse files Browse the repository at this point in the history
  • Loading branch information
AristurtleDev committed Sep 28, 2023
1 parent babeabd commit a48cc1e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ internal void AddRawImageCel(short x, short y, ushort width, ushort height, usho
internal void AddLinkedCel(ushort frameIndex)
{
AsepriteFrame frame = _frames[frameIndex];
AsepriteCel linkedCel = frame.Cels[_nextFrameCels.Count];
// If the first cel is a linked cel, then we haven't added cels yet
// so the " - 1" will result in -1. So we only do so when the count is
// greater than 0
AsepriteCel linkedCel = frame.Cels[_nextFrameCels.Count > 0 ? _nextFrameCels.Count - 1 : 0];
_nextFrameCels.Add(linkedCel);
}

Expand Down

0 comments on commit a48cc1e

Please sign in to comment.