-
Notifications
You must be signed in to change notification settings - Fork 78
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
TargetID: Make ttt_idenfity_body_woconfirm
replicated; move and clean up additional ConVars surrounding corpses/ragdolls
#1692
Conversation
…client can use it
…ia the ConVar object for consistency with the other globals in the hook
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.
First of all thanks for catching my mistake! That's what i get for only testing locally i suppose
As Tim somewhat started the review i'll leave it to him unless he tells me otherwise :)
ttt_idenfity_body_woconfirm
and ttt2_confirm_team
ttt_idenfity_body_woconfirm
replicated; move and clean up additional ConVars surrounding corpses/ragdolls
I've updated the title and description of the PR to more accurately describe its new goal(s). I'll also quickly update the changelog entry as well, for good measure. |
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.
that looks really good - thank you!
…an up additional ConVars surrounding corpses/ragdolls (#1692) In #1684, `targetid.HUDDrawTargetIDRagdolls` was updated to check if the `ttt_idenfity_body_woconfirm` ConVar was enabled to determine what hint gets displayed. Problem is, this ConVar only exists on the server, and the TargetID library is entirely clientside. This resulted in Lua errors being thrown on every frame the function was called and managed to reach that check. This PR adds an additional table to the `CORPSE` namespace for the purpose of storing ConVar objects related to corpses and bodysearching. The following `CreateConVar` calls have been moved from `sv_main`: - `ttt_idenfity_body_woconfirm` (to `sh_corpse`, with `FCVAR_REPLICATED` added) - `ttt2_confirm_team` (to `sv_corpse`) - `ttt2_confirm_killlist` (to `sv_corpse`) I've also moved the `CreateConVar` calls for `ttt_announce_body_found` and `ttt_ragdoll_collide` into the new table for consistency, and so scripts for other parts of the gamemode can access the ConVar objects directly without having to store their own separate copies (or calling `GetConVar` repeatedly). I've also already adjusted all existing checks for these ConVars across the gamemode accordingly. The changelog entry is worded the way it is because I just can't think of any other way to describe the results of the changes without going into a level of detail that'd be unnecessary for an end-user, but still useful information for addon developers.
In #1684,
targetid.HUDDrawTargetIDRagdolls
was updated to check if thettt_idenfity_body_woconfirm
ConVar was enabled to determine what hint gets displayed.Problem is, this ConVar only exists on the server, and the TargetID library is entirely clientside. This resulted in Lua errors being thrown on every frame the function was called and managed to reach that check.
This PR adds a GlobalBool and ChangeCallback forttt_idenfity_body_woconfirm
, and updates the check to use it instead of a nonexistent ConVar object. It also adds a ChangeCallback forttt2_confirm_team
, and changes its initialSetGlobal
call to grab its name from its ConVar object to be consistent with the other GlobalVars inSyncGlobals
.This PR adds an additional table to the
CORPSE
namespace for the purpose of storing ConVar objects related to corpses and bodysearching. The followingCreateConVar
calls have been moved fromsv_main
:ttt_idenfity_body_woconfirm
(tosh_corpse
, withFCVAR_REPLICATED
added)ttt2_confirm_team
(tosv_corpse
)ttt2_confirm_killlist
(tosv_corpse
)I've also moved the
CreateConVar
calls forttt_announce_body_found
andttt_ragdoll_collide
into the new table for consistency, and so scripts for other parts of the gamemode can access the ConVar objects directly without having to store their own separate copies (or callingGetConVar
repeatedly). I've also already adjusted all existing checks for these ConVars across the gamemode accordingly.The changelog entry is worded the way it is because I just can't think of any other way to describe the results of the changes without going into a level of detail that'd be unnecessary for an end-user, but still useful information for addon developers.