TTT2 icon indicating copy to clipboard operation
TTT2 copied to clipboard

playermodels: Add option to disable resetting player color via `ttt_enforce_playercolor` convar

Open Histalek opened this issue 1 year ago • 1 comments

This is mostly done to enhance compatibility with colourable playermodels.

Before this change coloured playermodels would be set to COLOR_WHITE or GAMEMODE.playercolor on (re)spawn to prevent players from being distinguished by different colours.

After this change this behaviour is not changed unless ttt_enforce_playercolor is set to 0. In that case we return early in the GM:TTTPlayerSetColor hook and do nothing. This does NOT however prevent other addons from hooking into the TTTPlayerSetColor hook nor does it prevent other addons from setting the playercolor somewhere else.

NOTE: This is also not tested yet, hence draft status

Histalek avatar Mar 09 '23 13:03 Histalek

ttt_playercolor_mode = 0 seems to be unused [1]. Which looks like a better approach to this.

[1] https://github.com/TTT-2/TTT2/blob/fd45084b5dddcaf8a46f23ecbf825295d2f21f59/gamemodes/terrortown/gamemode/shared/sh_main.lua#L355-L378

Histalek avatar Mar 11 '24 11:03 Histalek