From 07ba36956aed5400fc7b20f73985a42dfe34f355 Mon Sep 17 00:00:00 2001
From: Daniel Parks <danielrparks@utexas.edu>
Date: Wed, 26 Apr 2023 21:40:14 -0500
Subject: [PATCH] TAStudio/PatternsForm: Allow looping to entry zero

---
 .../tools/TAStudio/PatternsForm.cs                   | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/PatternsForm.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/PatternsForm.cs
index b45a4e8286..6e83cfed88 100644
--- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/PatternsForm.cs
+++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/PatternsForm.cs
@@ -130,18 +130,18 @@ namespace BizHawk.Client.EmuHawk
 				return;
 			}
 
-			// repeating zero times is not allowed
-			if ((int)CountNum.Value == 0)
-			{
-				CountNum.Value = 1;
-			}
-
 			if (PatternList.SelectedIndex == _counts.Count)
 			{
 				_loopAt = (int)CountNum.Value;
 			}
 			else
 			{
+				// repeating zero times is not allowed
+				if ((int)CountNum.Value == 0)
+				{
+					CountNum.Value = 1;
+				}
+
 				_counts[PatternList.SelectedIndex] = (int)CountNum.Value;
 			}