ttt_game_text does not work at all when set to "All except traitors"
Your version of TTT2 (mandatory)
Latest GitHub version
Describe the bug (mandatory)
GetTeamChatFilter(TEAM_INNOCENT) will always return an empty table, and so do GetTeamFilter(TEAM_INNOCENT) and GetInnocentFilter()
because ttt_game_text uses it, this breaks the "All except traitors" option https://github.com/TTT-2/TTT2/blob/b18611f3b4fa33c258b011de60d12e5141464fb9/gamemodes/terrortown/entities/entities/ttt_game_text.lua#L66
To reproduce
load into a map with a ttt_game_text entity that is set to send a message to "All except traitors"
no message will be displayed to non-traitors by the ttt_game_text entity
Expected behaviour
the message should be displayed to non-traitors, which is what i would assume should be expected by the phrase "All except traitors"
also, the GetInnocentFilter() function should just give a list of every player on the innocent team, it doesn't seem to make sense that it does all these extra checks when the function just means "give me every innocent player"
https://github.com/TTT-2/TTT2/blob/d76aa1b313d3766ef279cba252a233317e948e26/gamemodes/terrortown/gamemode/server/sv_gamemsg.lua#L141
it should just check for p:GetTeam() == TEAM_INNOCENT and (not alive_only or p:IsTerror()) and that's it
Thanks for your report. This is indeed a bug! This is also a nice issue :)
i assume the cause of the bug is that the function for getting a list of innocents tries to get a filter for the innocent chat, but since no such chat exists (which would make no sense of course), nothing gets returned