From 31fa8ead6da5b23279831d393a393f2e4621a4e5 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sun, 1 Jan 2012 21:09:04 +0100 Subject: [PATCH] sv_forceplayercolors --- qcsrc/client/autocvars.qh | 1 + qcsrc/client/csqcmodel_hooks.qc | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index d82990463..489f79dd4 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -377,6 +377,7 @@ float autocvar_cl_playerdetailreduction; float autocvar_cl_loddistance1 = 1024; float autocvar_cl_loddistance2 = 4096; float autocvar_cl_forceplayermodels; +float autocvar_cl_forceplayercolors; float autocvar__cl_playerskin; string autocvar__cl_playermodel; float autocvar_cl_precacheplayermodels; diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index 145218bce..12cae8eef 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -78,17 +78,20 @@ float forceplayermodels_attempted; .string forceplayermodels_savemodel; .float forceplayermodels_savemodelindex; .float forceplayermodels_saveskin; +.float forceplayermodels_savecolormap; void CSQCPlayer_ForceModel_PreUpdate(void) { self.model = self.forceplayermodels_savemodel; self.modelindex = self.forceplayermodels_savemodelindex; self.skin = self.forceplayermodels_saveskin; + self.colormap = self.forceplayermodels_savecolormap; } void CSQCPlayer_ForceModel_PostUpdate(void) { self.forceplayermodels_savemodel = self.model; self.forceplayermodels_savemodelindex = self.modelindex; self.forceplayermodels_saveskin = self.skin; + self.forceplayermodels_savecolormap = self.colormap; } void CSQCPlayer_ForceModel_Apply(float islocalplayer) { @@ -133,6 +136,11 @@ void CSQCPlayer_ForceModel_Apply(float islocalplayer) self.modelindex = self.forceplayermodels_savemodelindex; self.skin = self.forceplayermodels_saveskin; } + + // forceplayercolors too + if(!teamplay) + if(autocvar_cl_forceplayercolors) + self.colormap = player_localnum + 1; } // FEATURE: fallback frames -- 2.39.2