Thanks for the feedback.
Quote:
Originally Posted by Silvers
- You don't need to check "IsClientConnected" if you're checking "IsClientInGame" since that already checks they're connected.
|
I will keep this in mind for next time.
Quote:
Originally Posted by Silvers
- I highly recommend consolidating all the sound hook callbacks into 1, right now this is very inefficient since you're checking all the strings when 1 of them could have triggered already.
|
That is how I initially wrote the plugin, but ran into issues where sounds would double up in-game for no good reason and other weird artifacts that would not happen when separated. I will take another crack at it in the future.
Quote:
Originally Posted by Silvers
- You should replace "StrContains" with "strcmp" or "strncmp". Right now you're checking every position of the string for a match, this is inefficient and resourceful especially for something triggered as often as the sound hooks.
|
That is a good point. I essentially copy pasted from my footstep sounds plugin and did not think of making this kind of change. I will also keep it in mind.
Quote:
Originally Posted by Silvers
- Don't understand why you're blocking commands in "OnPlayerRunCmd" for bots. This might affect other plugins expecting bots to have commands coming through.
|
That would be an oversight. That is leftover code from a larger plugin I was working on, fixing a whole bunch of HL2DM issues. Ultimately, that larger plugin was replaced by custom C++ fixes instead, hence the smaller plugins released.
Quote:
Originally Posted by Silvers
- You're returning "Plugin_Changed" from the sound callbacks, but nothing is actually being changed.
|
I will make the necessary changes.
Quote:
Originally Posted by Silvers
- Lastly you don't need "public" for callbacks you named yourself. Just for plugin forwards (such as those from SM and 3rd party plugins).
|
Thanks for the tip!
Take care!