Skip to content
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

Merged
merged 7 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- Fixed console error when dropping ammo for weapons with no AmmoEnt (by @MrXonte)
- Fixed client error for a not fully initialized client (by @Histalek)
- Fixed the targetID corpse hint not respecting `ttt_identify_body_woconfirm` (by @Histalek)
- Fixed networked values for `ttt_identify_body_woconfirm` and `ttt2_confirm_team` not being updated properly when changed (by @Wryyyong)
- Fixed the beacon not being properly translated when placed (by @Histalek)

### Changed
Expand Down
13 changes: 11 additions & 2 deletions gamemodes/terrortown/gamemode/server/sv_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ local map_switch_delay = CreateConVar(

---
-- @realm server
CreateConVar(
local identify_body_woconfirm = CreateConVar(
TimGoll marked this conversation as resolved.
Show resolved Hide resolved
"ttt_identify_body_woconfirm",
"1",
{ FCVAR_NOTIFY, FCVAR_ARCHIVE },
Expand Down Expand Up @@ -505,7 +505,8 @@ function GM:SyncGlobals()
)
end

SetGlobalBool("ttt2_confirm_team", confirm_team:GetBool())
SetGlobalBool(identify_body_woconfirm:GetName(), identify_body_woconfirm:GetBool())
SetGlobalBool(confirm_team:GetName(), confirm_team:GetBool())

---
-- @realm server
Expand All @@ -520,6 +521,14 @@ cvars.AddChangeCallback(idle_enabled:GetName(), function(cv, old, new)
SetGlobalBool(idle_enabled:GetName(), tobool(tonumber(new)))
end)

cvars.AddChangeCallback(identify_body_woconfirm:GetName(), function(cv, old, new)
SetGlobalBool(identify_body_woconfirm:GetName(), tobool(tonumber(new)))
end)

cvars.AddChangeCallback(confirm_team:GetName(), function(cv, old, new)
SetGlobalBool(confirm_team:GetName(), tobool(tonumber(new)))
end)

---
-- This @{function} is used to load the shop equipments
-- @realm server
Expand Down
2 changes: 1 addition & 1 deletion lua/ttt2/libraries/targetid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ function targetid.HUDDrawTargetIDRagdolls(tData)
tData:AddDescriptionLine(TryT("corpse_hint_inspect_limited_details"))
elseif
bodysearch.GetInspectConfirmMode() == 0
and not GetConVar("ttt_identify_body_woconfirm"):GetBool()
and not GetGlobalBool("ttt_identify_body_woconfirm", true)
then
tData:SetSubtitle(ParT("corpse_hint_without_confirm", key_params))
else
Expand Down
Loading