Animation.cs - Fixed anim containing empty entry at the end of the string

This commit is contained in:
miku-666
2023-05-07 13:54:52 +02:00
parent 7ff6956d99
commit f942dcab8b

View File

@@ -51,11 +51,12 @@ namespace PckStudio.Forms.Editor
}
}
private void ParseAnim(string ANIM)
private void ParseAnim(string anim)
{
_ = ANIM ?? throw new ArgumentNullException(nameof(ANIM));
ANIM = (Interpolate = ANIM.StartsWith("#")) ? ANIM.Substring(1) : ANIM;
string[] animData = ANIM.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
_ = anim ?? throw new ArgumentNullException(nameof(anim));
anim = anim.Trim();
anim = (Interpolate = anim.StartsWith("#")) ? anim.Substring(1) : anim;
string[] animData = anim.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
int lastFrameTime = MinimumFrameTime;
if (animData.Length <= 0)
for (int i = 0; i < TextureCount; i++)