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

Handle positional sounds initating from a player's spot #1257

Merged

Conversation

Emojigit
Copy link
Contributor

This PR splits the sound-playing codes of ranged weapons into two: one for playing to the user and one for playing to the rest of the players.

The code playing sounds from a fixed position is kept but limited to non-users only. This is because the sounds are supposed to be coming from the fixed position where the gunshot starts. Alongside it, another code dedicated to playing sounds to the user is created to fix the sound position to the player's client-side position (because of lag, the server-side and client-side positions may vary, resulting in confusing sound positions).

You may log onto the official CTF server to feel the confusing gunshot sound position. Try to fire a pistol or rifle while running due left or right, and sounds will be played far away. After merging this PR, the issue should be fixed.

Codes in this PR increase the number of sound packets to be sent. Consider this before merging this PR if this would be a notable performance overhead. Otherwise, this PR is ready for review and merging.

@LoneWolfHT LoneWolfHT merged commit d74731a into MT-CTF:master Jan 2, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants