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

CG_CustomSound is broken #2974

Open
cu-kai opened this issue Apr 16, 2024 · 4 comments
Open

CG_CustomSound is broken #2974

cu-kai opened this issue Apr 16, 2024 · 4 comments

Comments

@cu-kai
Copy link
Contributor

cu-kai commented Apr 16, 2024

When testing the map mxl-school which appears to make use of these, the client is dropped by this line when falling off the ledge in the secret room by the computer room as a custom sound is triggered:

Sys::Drop( "Unknown custom sound: %s", soundName );

I have worked around this on Bunker by returning sounds/null.wav but that is a hack so I'm hesitant to PR such code until I understand why the existing code is broken.

@cu-kai
Copy link
Contributor Author

cu-kai commented Apr 16, 2024

Worth noting that the custom sound that causes the crash on mxl-school is one listed in this code: *falling1.wav

@sweet235
Copy link
Contributor

What is a sensible method to handle the case of a missing sound file? I would say: do the same as with missing textures. Print a warning, play nothing.

@cu-kai
Copy link
Contributor Author

cu-kai commented Apr 16, 2024

I have this exact fix running on bunker but the sound that causes the crash is listed in cg_customSoundNames so I'd imagine we should solve the actual bug rather than work around it?

static const char *const cg_customSoundNames[ MAX_CUSTOM_SOUNDS ] =
{
"*death1",
"*death2",
"*death3",
"*jump1",
"*pain25_1",
"*pain50_1",
"*pain75_1",
"*pain100_1",
"*falling1",
"*gasp",
"*drown",
"*fall1",
"*taunt"
};

@cu-kai
Copy link
Contributor Author

cu-kai commented Apr 16, 2024

In the Tremulous source code, the array of death sounds have extensions. Here, we do not have these.
See: https://github.com/darklegion/tremulous/blob/master/src/cgame/cg_players.c#L29-L44

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

No branches or pull requests

2 participants