mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-17 23:21:05 +00:00
I accidentally the numpad
also reduced the range of usable characters
This commit is contained in:
parent
bcddbdbfbf
commit
fb6570cade
1 changed files with 12 additions and 3 deletions
15
src/m_menu.c
15
src/m_menu.c
|
@ -7959,16 +7959,25 @@ static void M_HandleConnectIP(INT32 choice)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
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;
|
break;
|
||||||
|
|
||||||
l = strlen(setupm_ip);
|
// Rudimentary number and period enforcing - also allows letters so hostnames can be used instead
|
||||||
if (l < 28-1)
|
if ((choice >= 45 && choice <= 58) || (choice >= 65 && choice <= 90) || (choice >= 97 && choice <= 122))
|
||||||
{
|
{
|
||||||
S_StartSound(NULL,sfx_menu1); // Tails
|
S_StartSound(NULL,sfx_menu1); // Tails
|
||||||
setupm_ip[l] = (char)choice;
|
setupm_ip[l] = (char)choice;
|
||||||
setupm_ip[l+1] = 0;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue