fix: fake client targeting and harden client state resets#34
Open
Rushaway wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens ThirdPerson’s client validation and state-reset paths to prevent runtime exceptions when fake clients hit spawn/death flows that ultimately call client-targeted ConVar updates.
Changes:
- Bumped plugin version to 1.3.6.
- Fixed operator-precedence in
Event_PlayerDeathso client validity properly gates mirror/thirdperson reset logic. - Tightened spawn validation and added disconnect cleanup to clear per-client thirdperson/mirror state when slots are released.
Comment on lines
176
to
+177
| int client = GetClientOfUserId(GetEventInt(event, "userid")); | ||
| if (IsValidClient(client, true, false) && g_bThirdPerson[client] || g_bMirror[client]) | ||
| if (IsValidClient(client, true, false) && (g_bThirdPerson[client] || g_bMirror[client])) |
Comment on lines
206
to
208
| int client = GetClientOfUserId(GetEventInt(event, "userid")); | ||
| if (IsValidClient(client)) | ||
| if (IsValidClient(client, true)) | ||
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a runtime exception in ThirdPerson when a fake client is processed during spawn/death flow and eventually reaches camera/convar code paths.
Context
A server error was reported:
Root cause
Two logic issues made fake clients reachable in reset paths:
What changed
Behavior impact
Test plan
Risk
Low. Changes are scoped to validation/guard logic and state reset paths.