#66: joyconfig.bat no longer hangs the game -- clear BT_JOYCONFIG once the wizard is done
Found while sweeping the shipped launchers for the PATH-shadowing bug class.
Previously recorded ONLY as row 10 of docs/INPUT_PATH_AUDIT.md and never
filed, so it was invisible on the tracker.
joyconfig.bat sets BOTH `BT_JOYCONFIG=1` and `BT_FE_SOLO=1`, so after the
wizard writes bindings.txt the boot continues into the FRONT END, which hands
off by CreateProcessW()ing the next generation with the CURRENT environment.
That clear-list (btl4console.cpp) covers only BT_FE_EGG/PODS/SECS/LOOP --
BT_JOYCONFIG is never cleared -- so the handed-off generation re-entered
BTJoyConfigWizard() and blocked on _getch() BEHIND the 3D window: an
unrecoverable hang, hitting exactly the players most likely to run that bat
(flight stick / HOTAS / pedals).
Fix: SetEnvironmentVariableA("BT_JOYCONFIG", NULL) immediately after the
wizard returns. Cleared in the WIN32 environment (what CreateProcess
inherits, matching the console's own pattern) rather than the CRT copy, so
exactly one generation ever runs it. Chosen over extending the console's
clear-list because it also covers any future relaunch path.
NOT YET REBUILT: the exe was locked by a live play session when this landed.
Must be rebuilt + verified (run joyconfig.bat, finish the wizard, confirm no
second "=== BattleTech joystick setup ===" banner and that the game proceeds
into the menu) before the next zip is cut.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
bf40c53e1e
commit
373889760c
@@ -288,6 +288,18 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
{
|
||||
extern int BTJoyConfigWizard(void);
|
||||
BTJoyConfigWizard();
|
||||
//
|
||||
// ONE-SHOT (input-path audit row 10): joyconfig.bat sets BT_JOYCONFIG=1
|
||||
// *and* BT_FE_SOLO=1, so the wizard's process hands off to the front end,
|
||||
// which CreateProcess()es the next generation with the CURRENT environment
|
||||
// (btl4console.cpp clears only BT_FE_EGG/PODS/SECS/LOOP). The child then
|
||||
// re-entered the wizard and blocked on console input BEHIND the 3D window
|
||||
// -- an unrecoverable hang for anyone who configures a joystick. Clear it
|
||||
// in the Win32 environment (what CreateProcess inherits, matching the
|
||||
// console's own SetEnvironmentVariableA pattern) the moment the wizard is
|
||||
// done, so exactly one generation ever runs it.
|
||||
//
|
||||
SetEnvironmentVariableA("BT_JOYCONFIG", NULL);
|
||||
}
|
||||
|
||||
// MP wire-format probe (env BT_NET_PROBE=1): print the exact packet constants
|
||||
|
||||
Reference in New Issue
Block a user