TTT2
TTT2 copied to clipboard
playermodels: Add option to disable resetting player color via `ttt_enforce_playercolor` convar
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
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