mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Simpler loop
This commit is contained in:
parent
d5c06b31ad
commit
3e99d4838e
2 changed files with 21 additions and 36 deletions
|
|
@ -745,33 +745,25 @@ boolean CON_Responder(event_t *ev)
|
||||||
// check for console toggle key
|
// check for console toggle key
|
||||||
if (ev->type != ev_console)
|
if (ev->type != ev_console)
|
||||||
{
|
{
|
||||||
INT32 i, j;
|
|
||||||
|
|
||||||
if (modeattacking || metalrecording)
|
if (modeattacking || metalrecording)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (splitscreen && ev->data1 >= KEY_MOUSE1) // See also: HUD_Responder
|
if (ev->data1 >= KEY_MOUSE1) // See also: HUD_Responder
|
||||||
{
|
{
|
||||||
|
INT32 i;
|
||||||
|
boolean p1control = false;
|
||||||
|
|
||||||
for (i = 0; i < num_gamecontrols; i++)
|
for (i = 0; i < num_gamecontrols; i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < 2; j++)
|
if (gamecontrol[i][0] == ev->data1 || gamecontrol[i][1] == ev->data1)
|
||||||
{
|
{
|
||||||
if (gamecontrolbis[i][j] == ev->data1)
|
p1control = true;
|
||||||
return false;
|
break;
|
||||||
|
|
||||||
if (splitscreen > 1)
|
|
||||||
{
|
|
||||||
if (gamecontrol3[i][j] == ev->data1)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (splitscreen > 2)
|
|
||||||
{
|
|
||||||
if (gamecontrol4[i][j] == ev->data1)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!p1control)
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key == gamecontrol[gc_console][0] || key == gamecontrol[gc_console][1])
|
if (key == gamecontrol[gc_console][0] || key == gamecontrol[gc_console][1])
|
||||||
|
|
|
||||||
|
|
@ -1056,7 +1056,6 @@ static boolean justscrolledup;
|
||||||
boolean HU_Responder(event_t *ev)
|
boolean HU_Responder(event_t *ev)
|
||||||
{
|
{
|
||||||
INT32 c=0;
|
INT32 c=0;
|
||||||
INT32 i, j;
|
|
||||||
|
|
||||||
if (ev->type != ev_keydown)
|
if (ev->type != ev_keydown)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -1065,33 +1064,27 @@ boolean HU_Responder(event_t *ev)
|
||||||
|
|
||||||
// Shoot, to prevent P1 chatting from ruining the game for everyone else, it's either:
|
// Shoot, to prevent P1 chatting from ruining the game for everyone else, it's either:
|
||||||
// A. completely disallow opening chat entirely in online splitscreen
|
// A. completely disallow opening chat entirely in online splitscreen
|
||||||
// or B. iterate through all controls to make sure it's not bound to another player's
|
// or B. iterate through all controls to make sure it's bound to player 1 before eating
|
||||||
// You can see which one I chose.
|
// You can see which one I chose.
|
||||||
// (Unless if you're sharing a keyboard, since you probably establish when you start chatting that you have dibs on it...)
|
// (Unless if you're sharing a keyboard, since you probably establish when you start chatting that you have dibs on it...)
|
||||||
// (Ahhh, the good ol days when I was a kid who couldn't afford an extra USB controller...)
|
// (Ahhh, the good ol days when I was a kid who couldn't afford an extra USB controller...)
|
||||||
|
|
||||||
if (chat_on && splitscreen && ev->data1 >= KEY_MOUSE1)
|
if (ev->data1 >= KEY_MOUSE1)
|
||||||
{
|
{
|
||||||
|
INT32 i;
|
||||||
|
boolean p1control = false;
|
||||||
|
|
||||||
for (i = 0; i < num_gamecontrols; i++)
|
for (i = 0; i < num_gamecontrols; i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < 2; j++)
|
if (gamecontrol[i][0] == ev->data1 || gamecontrol[i][1] == ev->data1)
|
||||||
{
|
{
|
||||||
if (gamecontrolbis[i][j] == ev->data1)
|
p1control = true;
|
||||||
return false;
|
break;
|
||||||
|
|
||||||
if (splitscreen > 1)
|
|
||||||
{
|
|
||||||
if (gamecontrol3[i][j] == ev->data1)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (splitscreen > 2)
|
|
||||||
{
|
|
||||||
if (gamecontrol4[i][j] == ev->data1)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!p1control)
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!chat_on)
|
if (!chat_on)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue