Commit 6946e99
authored
#### Summary
On Windows 11 24H2, `BASS_ChannelSetFX(BASS_FX_DX8_I3DL2REVERB)` fails
with `BASS_ERROR_NOFX` (41) because the OS dropped the I3DL2 DMO.
`ApplyFxEffects` was swallowing the failure and storing
`INVALID_FX_HANDLE`, so the next `BASS_FXSetParameters` rejected the
bogus handle with `BASS_ERROR_HANDLE` (5). Scripts saw a misleading
"BASS error 5" on `roomHF`.
`ApplyFxEffects` now logs the real BASS error and clears
`m_EnabledEffects[i]` when the handle is `INVALID_FX_HANDLE`.
`setSoundEffectEnabled` returns the BASS-effective outcome via
`CBassAudio::IsFxEffectEnabled`, so `getSoundEffects` and the
`setSoundEffectParameter` "must be enabled" gate report the truth. Same
fix on `CClientPlayerVoice`.
#### Motivation
Fixes #4259.
`roomHF` is just the first I3DL2 parameter people try; any of the 12
errors identically. Code 5 (`BASS_ERROR_HANDLE`) was the latest BASS
error from the failed `BASS_FXSetParameters`, not the underlying 41
(`BASS_ERROR_NOFX`) from the much earlier `BASS_ChannelSetFX`, which was
never logged. Per [un4seen
docs](https://www.un4seen.com/doc/bass/BASS_ChannelSetFX.html):
*"Windows 11 24H2 removed the I3DL2REVERB effect, so it should be
avoided if you need to run on the latest Windows."* BASS does not
emulate it on Windows.
#### Test plan
- [x] Win 11 24H2: `setSoundEffectEnabled(s, "i3dl2reverb", true)`
returns `false`; console logs `BASS ERROR 41 in BASS_ChannelSetFX
(effect 6)`.
- [x] `setSoundEffectParameter(s, "i3dl2reverb", "roomHF", -100)` errors
with `Effect's parameters can't be set unless it's enabled` instead of
`BASS Error 5`.
- [x] `getSoundEffects(s).i3dl2reverb` returns `false` after the failed
enable.
- [x] Other DX8 effects (chorus, echo, flanger, etc.) still enable,
parameterise, and disable normally.
- [x] Re-enabling after a failed enable stays failed; no dangling
handle.
- [x] Same scenarios pass on the player-voice path.
#### Checklist
* [x] Your code should follow the [coding
guidelines](https://wiki.multitheftauto.com/index.php?title=Coding_guidelines).
* [x] Smaller pull requests are easier to review. If your pull request
is beefy, your pull request should be reviewable commit-by-commit.
1 parent 01c72fc commit 6946e99
4 files changed
Lines changed: 34 additions & 0 deletions
File tree
- Client/mods/deathmatch/logic
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1167 | 1167 | | |
1168 | 1168 | | |
1169 | 1169 | | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
1170 | 1175 | | |
| 1176 | + | |
1171 | 1177 | | |
1172 | 1178 | | |
1173 | 1179 | | |
| |||
1176 | 1182 | | |
1177 | 1183 | | |
1178 | 1184 | | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
1179 | 1190 | | |
1180 | 1191 | | |
1181 | 1192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| 364 | + | |
364 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
365 | 370 | | |
366 | 371 | | |
367 | 372 | | |
| |||
378 | 383 | | |
379 | 384 | | |
380 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
381 | 390 | | |
| 391 | + | |
382 | 392 | | |
383 | 393 | | |
384 | 394 | | |
| |||
390 | 400 | | |
391 | 401 | | |
392 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
393 | 408 | | |
394 | 409 | | |
395 | 410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
| 682 | + | |
682 | 683 | | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
683 | 688 | | |
684 | 689 | | |
685 | 690 | | |
| |||
688 | 693 | | |
689 | 694 | | |
690 | 695 | | |
| 696 | + | |
| 697 | + | |
691 | 698 | | |
692 | 699 | | |
693 | 700 | | |
| |||
0 commit comments