mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 12:01:47 +00:00
Merge branch 'panicpause' into 'master'
Pause local games if a player's gamepad disconnects See merge request KartKrew/Kart!2163
This commit is contained in:
commit
e011b21d6d
1 changed files with 10 additions and 3 deletions
|
|
@ -226,11 +226,9 @@ static void HandleGamepadDeviceRemoved(event_t *ev)
|
|||
int i = 0;
|
||||
I_Assert(ev != NULL);
|
||||
I_Assert(ev->type == ev_gamepad_device_removed);
|
||||
|
||||
G_UnregisterAvailableGamepad(ev->device);
|
||||
CONS_Alert(CONS_NOTICE, "Gamepad device %d disconnected\n", ev->device);
|
||||
|
||||
// Downstream responders need to update player gamepad assignments, pause, etc
|
||||
boolean playerinterrupted = false;
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
|
|
@ -238,8 +236,17 @@ static void HandleGamepadDeviceRemoved(event_t *ev)
|
|||
if (device == ev->device)
|
||||
{
|
||||
G_SetDeviceForPlayer(i, -1);
|
||||
playerinterrupted = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Downstream responders need to update player gamepad assignments, pause, etc
|
||||
G_UnregisterAvailableGamepad(ev->device);
|
||||
|
||||
if (playerinterrupted && Playing() && !netgame && !demo.playback)
|
||||
{
|
||||
M_StartControlPanel();
|
||||
}
|
||||
}
|
||||
|
||||
/// Respond to added/removed device events, for bookkeeping available gamepads.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue