Open tehORiON opened 8 years ago
Bumping this because I have a question: in other words, if we remove or comment m_iNext = SOUNDLIST_EMPTY;
the problem is fixed?
@JoelTroch That should do the trick yeah. This is obviously not an issue in singleplayer HL, but if using the AI in multiplayer scenarios an important part of the monster's AI behavior will be missing.
Alright, thank you ^^
Hi, noticed some issues with CSound causing trouble in the HL AI.
If you look at this function which resets sound on player death or player disconnect, it states that it doesn't "unlink" the sound, yet it clearly does with this line "m_iNext =SOUNDLIST_EMPTY;". Each client/player has their own unique reserved index in the soundlist, starting at the tail of the list 0 up to however many players might be on the server.
Now let's say that client # 10 dies and Reset is then called on his reserved sound, because m_iNext is set to -1 on reset and thus becoming the new 'tail' the rest of the list is then unlinked. And it stay's this way after he spawns again.
This is a problem in functions such as "CBaseMonster :: Listen()", which traverses the soundlist with m_iNext looking for an audible sound, which causes everyone but the one with the highest client number to be ignored by the monster.
These reserved sound slots should never get unlinked.