Closed FreeSlave closed 3 months ago
We probably need that mixer rewrite I planned a while ago.
Turns out, it isn't a mixer error, but yet another undocumented Xash extension.
In SV_BuildSoundMsg
, there is a check:
if( SV_IsValidEdict( ent ) && SV_IsValidEdict( ent->v.aiment ))
entityIndex = NUM_FOR_EDICT( ent->v.aiment );
else if( SV_IsValidEdict( ent ))
entityIndex = NUM_FOR_EDICT( ent );
else entityIndex = 0; // assume world
When an entity has an aiment set, the sound is automatically gets attached to that entity.
I think this check is kinda stupid, if a game developer explicitly passed an edict to EmitSound
, then they might actually want to play sound from that entity, not from whatever was set in the aiment
.
This check was added more than 10 years ago: https://github.com/FWGS/Xash3DArchive/commit/8f6f3fc351d1ff55e718643174e30e477e0eb5d0. Judging by changelog entry, it was made to fix the sound problem with weapons
. I'm pretty sure this is an outdated check and can be safely reverted.
080eba948fa8cb5a26278529a939c6c82a1a9412
I have the entity that creates the entity singletone which plays a sound either in world or on player by attaching itself to the player.
The point is to override any sentence which is currently played on CHAN_VOICE on triggering other
ambient_radio
. This way we should ensure that two sentences don't play in parallel, and it works this way in GoldSource.However it doesn't work as expected in Xash3D, at least when one
ambient_radio
plays a sentence in world, and other one plays another sentence on the player. Instead both are playing in parallel.Here's the test map: radiotest.bsp.zip. Push two buttons to reproduce the bug.
Field Intensity mod is affected by the bug when playing on Xash3D, on the map fid1a0a. Pickup the radio right after the radioman plays its sentence and you'll hear his next sentence playing in parallel to the previous one.