Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: randomly attack command does not work after starting new game #875

Open
ballotz opened this issue Dec 16, 2023 · 3 comments
Open

BUG: randomly attack command does not work after starting new game #875

ballotz opened this issue Dec 16, 2023 · 3 comments

Comments

@ballotz
Copy link

ballotz commented Dec 16, 2023

Could be related to #283

replicated building from master branch fa5d11e

Windows 10, built with VS2019, platform toolset v142

1 - start new game from main menu
2 - press fire
3 - if fire works, go to step 1
4 - pressing the fire button (both mouse or keyboard) does not make weapon to fire, other controls seems to work properly

I can replicate it after a few tries, (usually from 3 to 5) with a debug build in windowed mode.

It is a bit difficult to debug because the bug goes away when the game window looses and gets focus again.
To debug it I put a breakpoint in keys.c:2111, then repeat the steps above firing with the mouse, so the breakpoint does not hit.
Then when the bug shows, I hit CTRL to fire so the breakpoint is hit while the bug is happening.
Following the attack command seems that the problem is on the server.
sv_user.c: 4561
for some reason, randomly Info_Get(&cl->userinfoshort_ctx, "chat"); does not return an empty string so the attack command is masked away.

@ballotz
Copy link
Author

ballotz commented Dec 22, 2023

I noticed that he code mentioned above that I suppose is causing the bug, is under the CHAT_ICON_EXPERIMENTAL #ifdef.
That macro is defined in server.h and seems coming from an old 2008 commit 358380c
The name experimental does not sounds promising, but maybe it is a currently used feature, idk
Wonder if it can be just removed

@dsvensson
Copy link
Collaborator

Is this something that resurfaced with fbcf8a8 ?

@ballotz
Copy link
Author

ballotz commented Dec 24, 2023

Yes, I checked on 580b371 and the issue occurred at third try.
Reading the comments under #ifdef CHAT_ICON_EXPERIMENTAL seems that that code is preventig user from firing while in console. Maybe some variable is not properly initialized and after starting a new game the server thinks that the console is opended? An other action that fixes the issue is opening and closing the console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants