mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 04:41:23 +00:00
Skip setting control if keynum is -1 (for KEY_PAUSE) handling
This commit is contained in:
parent
6f8b126586
commit
e20c70d5fb
1 changed files with 22 additions and 14 deletions
|
@ -1346,10 +1346,10 @@ static INT32 G_FilterKeyByVersion(INT32 numctrl, INT32 keyidx, INT32 player, INT
|
||||||
*keynum2 = 0;
|
*keynum2 = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return 0;
|
return -1; // skip setting control
|
||||||
}
|
}
|
||||||
else if (keyidx == 1 && *keynum2 == KEY_PAUSE)
|
else if (keyidx == 1 && *keynum2 == KEY_PAUSE)
|
||||||
return 0;
|
return -1; // skip setting control
|
||||||
|
|
||||||
#if !defined (DC) && !defined (_PSP) && !defined (GP2X) && !defined (_NDS) && !defined(WMINPUT) && !defined(_WII)
|
#if !defined (DC) && !defined (_PSP) && !defined (GP2X) && !defined (_NDS) && !defined(WMINPUT) && !defined(_WII)
|
||||||
if (GETMAJOREXECVERSION(cv_execversion.value) < 27 && ( // v2.1.22
|
if (GETMAJOREXECVERSION(cv_execversion.value) < 27 && ( // v2.1.22
|
||||||
|
@ -1460,26 +1460,34 @@ static void setcontrol(INT32 (*gc)[2])
|
||||||
keynum2 = G_KeyStringtoNum(COM_Argv(3));
|
keynum2 = G_KeyStringtoNum(COM_Argv(3));
|
||||||
keynum = G_FilterKeyByVersion(numctrl, 0, player, &keynum1, &keynum2);
|
keynum = G_FilterKeyByVersion(numctrl, 0, player, &keynum1, &keynum2);
|
||||||
|
|
||||||
(void)G_CheckDoubleUsage(keynum, true);
|
if (keynum >= 0)
|
||||||
|
|
||||||
// if keynum was rejected, try it again with keynum2
|
|
||||||
if (!keynum && keynum2)
|
|
||||||
{
|
{
|
||||||
keynum1 = keynum2; // push down keynum2
|
|
||||||
keynum2 = 0;
|
|
||||||
keynum = G_FilterKeyByVersion(numctrl, 0, player, &keynum1, &keynum2);
|
|
||||||
(void)G_CheckDoubleUsage(keynum, true);
|
(void)G_CheckDoubleUsage(keynum, true);
|
||||||
|
|
||||||
|
// if keynum was rejected, try it again with keynum2
|
||||||
|
if (!keynum && keynum2)
|
||||||
|
{
|
||||||
|
keynum1 = keynum2; // push down keynum2
|
||||||
|
keynum2 = 0;
|
||||||
|
keynum = G_FilterKeyByVersion(numctrl, 0, player, &keynum1, &keynum2);
|
||||||
|
if (keynum >= 0)
|
||||||
|
(void)G_CheckDoubleUsage(keynum, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gc[numctrl][0] = keynum;
|
if (keynum >= 0)
|
||||||
|
gc[numctrl][0] = keynum;
|
||||||
|
|
||||||
if (keynum2)
|
if (keynum2)
|
||||||
{
|
{
|
||||||
keynum = G_FilterKeyByVersion(numctrl, 1, player, &keynum1, &keynum2);
|
keynum = G_FilterKeyByVersion(numctrl, 1, player, &keynum1, &keynum2);
|
||||||
if (keynum != gc[numctrl][0])
|
if (keynum >= 0)
|
||||||
gc[numctrl][1] = keynum;
|
{
|
||||||
else
|
if (keynum != gc[numctrl][0])
|
||||||
gc[numctrl][1] = 0;
|
gc[numctrl][1] = keynum;
|
||||||
|
else
|
||||||
|
gc[numctrl][1] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
gc[numctrl][1] = 0;
|
gc[numctrl][1] = 0;
|
||||||
|
|
Loading…
Reference in a new issue