-
-
Notifications
You must be signed in to change notification settings - Fork 461
NormalSHook erroring on non-IsInGame clients #1450
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
NormalSHook erroring on non-IsInGame clients #1450
Conversation
Did you check if this is true for all engine versions SM supports? Did you actually test it on any? |
It looks like it has always checked if the client is active in both older and newer engine versions. |
|
I really don't remember why this was added, I think I hit a filter or something that crashed on a mid-connecting client. That's the reason this one hasn't been merged yet, I know it's painful but the only path to merge this one would be to test every game presently. |
|
Alternatively, how about removing the client from the |
I think that's a fine idea |
|
I force pushed a commit to remove clients from the edit: memmove(&players[i], &players[i+1], (size-i-1) * sizeof(int));
--i;
--size;this would be funny memmove(&players[i], &players[i+1], (size-- - --i) * sizeof(int)); |
asherkin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I think this looks sane to me, but I'd like a 2nd ack for merge.
IEngineSound::EmitSoundseems to be called with clients in the filter that might not beIsInGame()which can throw an error when using aNormalSHookand returningPlugin_Changedsince all the clients will will be checked ifIsInGame().Using
CBroadcastRecipientFilterwould add all players than can be grabbed withUTIL_PlayerByIndexand is probably cause ofEmitSoundhaving clients that are notIsInGame().This PR has been changed to remove clients from the
playersarray that are notIsInGame(). Also a check for the callback-providedsizevariable has been addedpreviously
Removing the `IsInGame()` check should be fine since `EmitSound` eventually uses `CGameClient::IsActive()` to only send to active clients.EmitSound->EmitSoundInternal->SV_StartSound->sv.BroadcastSoundCGameClient->CBaseClientvirtual bool IsActive( void ) const { return m_nSignonState == SIGNONSTATE_FULL; };