]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/csqcmodel_hooks.qc
Add a mutator hook to skip only color forcing on players, add a mutator hook when...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / csqcmodel_hooks.qc
index 99456bd3ed03d129d2fb2ffc741e380e612f66ec..f08378b6a86b27546eed52fe92434375c9615b5b 100644 (file)
@@ -133,6 +133,9 @@ void CSQCPlayer_ModelAppearance_PostUpdate(entity this)
 }
 void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
 {
+       int cm = this.forceplayermodels_savecolormap;
+       cm = (cm >= 1024) ? cm : (entcs_GetClientColors(cm - 1) + 1024);
+
        if(MUTATOR_CALLHOOK(ForcePlayermodels_Skip, this, islocalplayer))
                goto skipforcemodels;
 
@@ -193,9 +196,6 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
 
        // apply it
        bool isfriend;
-       int cm;
-       cm = this.forceplayermodels_savecolormap;
-       cm = (cm >= 1024) ? cm : (entcs_GetClientColors(cm - 1) + 1024);
 
        if(teamplay)
                isfriend = (cm == 1024 + 17 * myteam);
@@ -227,6 +227,11 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
                this.skin = this.forceplayermodels_saveskin;
        }
 
+       LABEL(skipforcemodels)
+
+       if(MUTATOR_CALLHOOK(ForcePlayercolors_Skip, this, islocalplayer))
+               goto skipforcecolors;
+
        // forceplayercolors too
        if(teamplay)
        {
@@ -280,7 +285,7 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
                        this.colormap = player_localnum + 1;
        }
 
-       LABEL(skipforcemodels)
+       LABEL(skipforcecolors)
 
        if((this.csqcmodel_effects & CSQCMODEL_EF_RESPAWNGHOST) && !autocvar_cl_respawn_ghosts_keepcolors)
        {