mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Don't set controls to keys out of array bounds
Shout-out to TAG's config that somehow had `setcontrol2 "custom3" "KEY931926528"`, cuasing the game to crash only in Splitscreen.
This commit is contained in:
parent
003f3769df
commit
a127045d98
1 changed files with 8 additions and 1 deletions
|
|
@ -662,7 +662,14 @@ INT32 G_KeyStringtoNum(const char *keystr)
|
|||
return keystr[0];
|
||||
|
||||
if (!strncmp(keystr, "KEY", 3) && keystr[3] >= '0' && keystr[3] <= '9')
|
||||
return atoi(&keystr[3]);
|
||||
{
|
||||
/* what if we out of range bruh? */
|
||||
j = atoi(&keystr[3]);
|
||||
if (j < NUMINPUTS)
|
||||
return j;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (j = 0; j < NUMKEYNAMES; j++)
|
||||
if (!stricmp(keynames[j].name, keystr))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue