Skip to content

Commit 8436d8f

Browse files
authored
fix players sometimes being revealed as dead when they chat/voicechat right as they die (#1785)
from Facepunch/garrysmod#2229
1 parent 9afc0bb commit 8436d8f

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
1212
- Updated Russian and English localization files (by @Satton2)
1313
- Updated the list of troublesome addons used by the addonchecker
1414

15+
### Fixed
16+
17+
- Fixed players sometimes being revealed as dead when they chat/voicechat right as they die (Facepunch/garrysmod/pull/2229, by @wgetJane)
18+
1519
## [v0.14.2b](https://github.com/TTT-2/TTT2/tree/v0.14.2b) (2025-02-02)
1620

1721
### Fixed

gamemodes/terrortown/gamemode/client/cl_chat.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,24 @@ local function TTT_RoleChat()
5555
end
5656
net.Receive("TTT_RoleChat", TTT_RoleChat)
5757

58+
--
59+
-- Returns the color for the given entity's team.
60+
-- @param Entity ent The @{Entity}
61+
-- @hook
62+
-- @realm client
63+
-- @ref https://wiki.facepunch.com/gmod/GM:GetTeamColor
64+
-- @local
65+
function GM:GetTeamColor(ent)
66+
-- don't reveal that a player has died when they happen to chat or voicechat at the moment of death
67+
if ent:IsPlayer() and ent:IsSpec() and ScoreGroup(ent) == GROUP_NOTFOUND then
68+
--
69+
-- @realm client
70+
return hook.Run("GetTeamNumColor", TEAM_TERROR)
71+
end
72+
73+
return BaseClass.GetTeamColor(self, ent)
74+
end
75+
5876
---
5977
-- Called when a message is printed to the chat box. Note, that this isn't
6078
-- working with @{Player} messages even though there are arguments for it.<br />

0 commit comments

Comments
 (0)