From 46e50a523f2d6075a70813844940a212dee8f16b Mon Sep 17 00:00:00 2001
From: toasterbabe <rollerorbital@gmail.com>
Date: Tue, 19 Jul 2016 01:19:03 +0100
Subject: [PATCH] Let's be consistent with how other parts of the code handle
 this same issue of conditional operations surrounding non-conditional
 operations.

---
 src/m_menu.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/m_menu.c b/src/m_menu.c
index 10f9902750..16f63231e2 100644
--- a/src/m_menu.c
+++ b/src/m_menu.c
@@ -4829,6 +4829,7 @@ static void M_DrawSetupChoosePlayerMenu(void)
 	const INT32 my = 24;
 	patch_t *patch;
 	INT32 i, o, j, prev, next;
+	boolean loophack = false;
 
 	// Black BG
 	V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
@@ -4858,12 +4859,16 @@ static void M_DrawSetupChoosePlayerMenu(void)
 	o = ((char_scroll / FRACUNIT) + 16);
 
 	if (o < 0) // This hack is to prevent visual glitches when looping from the last character to the 1st character.
-	{
+		loophack = true;
+
+	if (loophack)
 		o += 128;
 
-		i = (o / 128);
-		o = (o % 128);
+	i = (o / 128);
+	o = (o % 128);
 
+	if (loophack)
+	{
 		j = i;
 		do // subtract 1 from i to counteract the +128 from the prior hack
 		{
@@ -4872,11 +4877,6 @@ static void M_DrawSetupChoosePlayerMenu(void)
 				i = (currentMenu->numitems - 1);
 		} while (i != j && PlayerMenu[i].status & IT_DISABLED);
 	}
-	else // Regular circumstances
-	{
-		i = (o / 128);
-		o = (o % 128);
-	}
 
 	// Get prev character...
 	prev = i;
-- 
GitLab