Skip to content

Commit

Permalink
Fix: Prevent spectators, covert, and long range corpse searches from …
Browse files Browse the repository at this point in the history
…making sound (#1698)
  • Loading branch information
TW1STaL1CKY authored Dec 26, 2024
1 parent 266ffd1 commit 043eee5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- Fixed the beacon not being properly translated when placed (by @Histalek)
- Fixed binoculars zooming not being predicted (by @Histalek)
- Fixed an error when trying to pickup a placed equipment (e.g. beacon) (by @Histalek)
- Fixed corpse searching sound playing when searched by a spectator, searched covertly, or searched long range (by @TW1STaL1CKY)

### Changed

Expand Down
12 changes: 7 additions & 5 deletions gamemodes/terrortown/gamemode/server/sv_corpse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,14 @@ function CORPSE.ShowSearch(ply, rag, isCovert, isLongRange)
ply.searchID = sceneData.searchUID

-- play sound when the body was searched
-- note: These sounds are pretty quiet and are therefore played thrice to increase the volume
local soundSelected = table.Random(soundsSearch)
if ply:IsTerror() and not isCovert and not isLongRange then
-- note: These sounds are pretty quiet and are therefore played thrice to increase the volume
local soundSelected = table.Random(soundsSearch)

rag:EmitSound(soundSelected, 100)
rag:EmitSound(soundSelected, 100)
rag:EmitSound(soundSelected, 100)
rag:EmitSound(soundSelected, 100)
rag:EmitSound(soundSelected, 100)
rag:EmitSound(soundSelected, 100)
end

local roleData = ply:GetSubRoleData()
if ply:IsActive() and roleData.isPolicingRole and roleData.isPublicRole and not isCovert then
Expand Down

0 comments on commit 043eee5

Please sign in to comment.