I accidentally the numpad

also reduced the range of usable characters
This commit is contained in:
ThatAwesomeGuy173 2019-01-26 02:41:05 -07:00
parent bcddbdbfbf
commit fb6570cade

View file

@ -7959,16 +7959,25 @@ static void M_HandleConnectIP(INT32 choice)
break;
default:
if (choice < 32 || choice > 127) // also allows letters to be typed in so hostnames can be used instead of an IP
l = strlen(setupm_ip);
if (l >= 28-1)
break;
l = strlen(setupm_ip);
if (l < 28-1)
// Rudimentary number and period enforcing - also allows letters so hostnames can be used instead
if ((choice >= 45 && choice <= 58) || (choice >= 65 && choice <= 90) || (choice >= 97 && choice <= 122))
{
S_StartSound(NULL,sfx_menu1); // Tails
setupm_ip[l] = (char)choice;
setupm_ip[l+1] = 0;
}
else if (choice >= 199 && choice <= 211 && choice != 202 && choice != 206) //numpad too!
{
char keypad_translation[] = {'7','8','9','-','4','5','6','+','1','2','3','0','.'};
choice = keypad_translation[choice - 199];
S_StartSound(NULL,sfx_menu1); // Tails
setupm_ip[l] = (char)choice;
setupm_ip[l+1] = 0;
}
break;
}