From b9c6210822b7b147820deb3b289c6587dbce2dcc Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Thu, 25 Oct 2018 20:02:43 +0200 Subject: [PATCH] Reimplemented the splitscreen chat fix --- src/hu_stuff.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 45a2aac1..4210b70e 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1057,6 +1057,26 @@ boolean HU_Responder(event_t *ev) // only KeyDown events now... + // Shoot, to prevent P1 chatting from ruining the game for everyone else, it's either: + // A. completely disallow opening chat entirely in online splitscreen + // or B. iterate through all controls to make sure it's bound to player 1 before eating + // 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...) + // (Ahhh, the good ol days when I was a kid who couldn't afford an extra USB controller...) + + if (ev->data1 >= KEY_MOUSE1) + { + INT32 i; + for (i = 0; i < num_gamecontrols; i++) + { + if (gamecontrol[i][0] == ev->data1 || gamecontrol[i][1] == ev->data1) + break; + } + + if (i == num_gamecontrols) + return false; + } + if (!chat_on) { // enter chat mode