foxygit / doom Log in
commit d87ca2113df9e424cad5fab4862a6c637de128b5
Author:     jens <jens.se@icloud.com>
AuthorDate: Sat Aug 22 09:28:32 2026 +0200
Commit:     jens <jens.se@icloud.com>
CommitDate: Sat Aug 22 09:28:32 2026 +0200

    Fix lobby join-locally key not matching the user's actual Use binding

    G_Responder's lobby handling checked ev->data1 against a hardcoded
    ' ' for "join locally", but that's just vanilla's default Use key -
    users can and do rebind it (key_use), and a literal space never
    matches whatever they've actually configured. Check against key_use
    itself instead, so it works with whatever key each player has bound,
    default or not.

    Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
---
 src/doom/g_game.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/doom/g_game.c b/src/doom/g_game.c
index 84f8ae62..bf0fa19f 100644
--- a/src/doom/g_game.c
+++ b/src/doom/g_game.c
@@ -963,15 +963,17 @@ boolean G_Responder (event_t* ev)
     // codes, the automap) while still waiting in the lobby and which
     // would otherwise have first claim on these same keypresses.
     // Nobody is seated automatically here - the host at the keyboard is
-    // just as optional as anyone else, and joins locally the same way a
-    // second local player would (Space), or not at all if they'd rather
-    // play from their own phone. Enter starts the game once at least
-    // one player - local or phone - has joined; ignored while the
-    // lobby is still completely empty, since there would be nobody to
-    // render a view for.
+    // just as optional as anyone else, and joins locally by pressing
+    // their own configured Use key (key_use - not hardcoded, since a
+    // literal ' ' doesn't match whatever a player has actually bound,
+    // default or not), same as a second local player would, or not at
+    // all if they'd rather play from their own phone. Enter starts the
+    // game once at least one player - local or phone - has joined;
+    // ignored while the lobby is still completely empty, since there
+    // would be nobody to render a view for.
     if (lobby_active)
     {
-        if (ev->type == ev_keydown && ev->data1 == ' ')
+        if (ev->type == ev_keydown && ev->data1 == key_use)
         {
             G_AddNextLocalPlayer ();
         }