Skip to content

Commit

Permalink
handling non-public policing roles
Browse files Browse the repository at this point in the history
  • Loading branch information
TimGoll committed Oct 10, 2023
1 parent 60cb90a commit 9cc3d1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
4 changes: 2 additions & 2 deletions gamemodes/terrortown/gamemode/client/cl_search.lua
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function SEARCHSCRN:Show(data)
}, 62)
elseif bodysearch.CanReportBody(data.ragOwner)
and not bodysearch.IsConfirmed(data.ragOwner)
and not clientRD.isPolicingRole and not clientRD.isPublicRole
and not (clientRD.isPolicingRole and clientRD.isPublicRole)
then
local searchMode = bodysearch.GetInspectConfirmMode()

Expand Down Expand Up @@ -320,7 +320,7 @@ function SEARCHSCRN:Show(data)
buttonConfirm.DoClick = function(btn)
local creditsOnly = playerCanTakeCredits
and GetConVar("ttt2_inspect_confirm_mode"):GetInt() > 0
and not clientRD.isPolicingRole and not clientRD.isPublicRole
and not (clientRD.isPolicingRole and clientRD.isPublicRole)

bodysearch.ClientConfirmsCorpse(data.rag, data.searchUID, data.lrng, creditsOnly)

Expand Down
8 changes: 0 additions & 8 deletions gamemodes/terrortown/gamemode/server/sv_corpse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,6 @@ function CORPSE.IdentifyBody(ply, rag, searchUID)
return
end

local roleData = ply:GetSubRoleData()

--if bodysearch.GetInspectConfirmMode() == 2 and not roleData.isPolicingRole and not roleData.isPublicRole then
-- LANG.Msg(ply, "inspect_detective_only", nil, MSG_MSTACK_WARN)

-- return false
--end

---
-- @realm server
if not hook.Run("TTTCanIdentifyCorpse", ply, rag) then return end
Expand Down
8 changes: 4 additions & 4 deletions lua/ttt2/libraries/targetid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -491,15 +491,15 @@ function targetid.HUDDrawTargetIDRagdolls(tData)
if tData:GetEntityDistance() <= 100 then
if client:IsSpec() then
tData:SetSubtitle(ParT("corpse_hint_spec", key_params))
elseif bodysearch.GetInspectConfirmMode() == 2 and not roleDataClient.isPolicingRole and not roleDataClient.isPublicRole then
elseif bodysearch.GetInspectConfirmMode() == 2 and not (roleDataClient.isPolicingRole and roleDataClient.isPublicRole) then
-- a detective added search results, this should change the targetID
if ent.bodySearchResult and ent.bodySearchResult.base and ent.bodySearchResult.base.isPublicPolicingSearch then
if ent.bodySearchResult and ent.bodySearchResult.base.isPublicPolicingSearch then
tData:SetSubtitle(ParT("corpse_hint_public_policing_searched", key_params))
else
tData:SetSubtitle(ParT("corpse_hint_no_inspect", key_params))
end
tData:AddDescriptionLine(TryT("corpse_hint_no_inspect_details"))
elseif bodysearch.GetInspectConfirmMode() == 1 and not roleDataClient.isPolicingRole and not roleDataClient.isPublicRole then
elseif bodysearch.GetInspectConfirmMode() == 1 and not (roleDataClient.isPolicingRole and roleDataClient.isPublicRole) then
tData:SetSubtitle(ParT("corpse_hint_inspect_only", key_params))
tData:AddDescriptionLine(TryT("corpse_hint_inspect_only_details"))
else
Expand Down Expand Up @@ -528,7 +528,7 @@ function targetid.HUDDrawTargetIDRagdolls(tData)
end

-- add info if searched by detectives
if ent.bodySearchResult and ent.bodySearchResult.base and ent.bodySearchResult.base.isPublicPolicingSearch then
if ent.bodySearchResult and ent.bodySearchResult.base.isPublicPolicingSearch then
tData:AddDescriptionLine(
TryT("corpse_searched_by_detective"),
roles.DETECTIVE.ltcolor,
Expand Down

0 comments on commit 9cc3d1c

Please sign in to comment.