Repository navigation
fix: clear PlayerActionManager placeholder input index as retail (Alt-tab freeze fix) - #65
Open
AndreasLauvhjell wants to merge 1 commit into
Open
AndreasLauvhjell wants to merge 1 commit into
AndreasLauvhjell wants to merge 1 commit into
Conversation
The constructor builds the three neutral send actions through PlayerAction::set, which never writes m_inputIndex, so the index held stack garbage. transmit sends slot 0's index as the packet base index while add() slides the placeholders out; a large garbage value raised the server's received-action high-water mark above every real index, so all later actions were dropped and the client froze after spawn (connectionProblem). Retail stores 0 before set(): bf2_w32ded.exe ctor 0x6173c0 (store 0x61741c), BF2.exe ctor 0x5bffb0 (store 0x5c0004); set() at 0x55c150 / 0x5bc890 does not touch +0x00. Linux ELF not checked.
This was referenced Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the client freezing right after spawn if you have alt-tabbed out at any point (connection problem).
The PlayerActionManager constructor builds three neutral send actions through PlayerAction::set,
which never writes m_inputIndex, so the index held stack garbage. transmit sends slot 0's index as
the packet base index, so a large garbage value pushed the server's received-action high-water mark
above every real index and all later actions were dropped.
Retail stores 0 before set():
Linux bf2 1.5.3153.0 (dedicated server) matches, no platform difference:
set() writes only +0x04..+0x18, never +0x00. The constructed action is then copied into all three
stored placeholder actions, so without the store the stack garbage reaches all three.
Files: Code/BF2/Game/Common/PlayerActionManager.cpp (3 lines).
Tested: rebuilt x86 client against a retail 1.50 dedicated server, played on strike_at_karkand and dragon_valley, spawned countless times, no freeze.
Not tested: rebuilt dedicated server, Linux server.
Frontiers: none added or removed.
Local CI check
Local mirror of the Windows jobs in .github/workflows/build.yml, run on main (ccf3099)
plus #64, #65 and #66 together (not one by one), from empty build dirs:
Toolchain: VS 2026 (MSVC 19.51); CI uses VS 2022. Linux job not run locally.