Skip to content

Commit

Permalink
Markervision: Fix Unknown Teams (#1581)
Browse files Browse the repository at this point in the history
Fixes #1477 by making sure that the whole team is only notified if the
player knows about their team mates.

---------

Co-authored-by: Histalek <[email protected]>
  • Loading branch information
TimGoll and Histalek authored Aug 17, 2024
1 parent dad1262 commit 4711d7d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- Fixed `table.FullCopy(tbl)` behaviour when `tbl` contained a Vector or Angle (by @Histalek)
- Fixed the bodysearch showing a wrong player icon when searching a fake body (by @TimGoll)
- Fixed players respawned with `ply:Revive` sometimes spawning on a fake corpse (by @TimGoll)
- Fixed markerVision elements being visible to team mates of unknown teams (such as team Innocent) (by @TimGoll)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,15 @@ if SERVER then
end
elseif self.data.visibleFor == VISIBLE_FOR_TEAM then
if IsPlayer(self.data.owner) then
self.receiverList = GetTeamFilter(self.data.owner:GetTeam(), false, true)
local team = self.data.owner:GetTeam()
local subRoleData = self.data.owner:GetSubRoleData()

-- visible for team is restricted when the team is unknown
if subRoleData.unknownTeam or team == TEAM_NONE or TEAMS[team].alone then
self.receiverList = { self.data.owner }
else
self.receiverList = GetTeamFilter(team, false, true)
end
else
-- handle static team
self.receiverList = GetTeamFilter(self.data.owner, false, true)
Expand Down

0 comments on commit 4711d7d

Please sign in to comment.