]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/csqcmodel_hooks.qc
Merge branch 'master' into Juhu/battle-royale
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / csqcmodel_hooks.qc
index 78b84fdea6f3da3801773ede0622c4bbd6207cb5..4ce5c74a392ea94a0e4053b3156680fcf73c0765 100644 (file)
@@ -207,6 +207,8 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
 
        if(teamplay)
                isfriend = (cm == 1024 + 17 * myteam);
+       else if(ISGAMETYPE(BR))
+           isfriend = br_isSameSquad(this.entnum);
        else
                isfriend = islocalplayer;
 
@@ -252,6 +254,11 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
                if ((team_count == 2) && (myteam != NUM_SPECTATOR) && (fpc == 2 || fpc == 4 || fpc == 5))
                        forceplayercolors_enabled = true;
        }
+       else if (ISGAMETYPE(BR))
+       {
+               if (br_inSquad() && (fpc == 2 || fpc == 5))
+                       forceplayercolors_enabled = true;
+       }
        else
        {
                if (fpc == 1 || fpc == 2)
@@ -259,7 +266,7 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
        }
 
        // forceplayercolors too
-       if(teamplay)
+       if(teamplay || ISGAMETYPE(BR))
        {
                // own team's color is never forced
                int forcecolor_friend = 0, forcecolor_enemy = 0;
@@ -271,7 +278,7 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
                if(forceplayercolors_enabled)
                        forcecolor_enemy = 1024 + autocvar__cl_color;
 
-               if(forcecolor_enemy && !forcecolor_friend)
+               if(!ISGAMETYPE(BR) && forcecolor_enemy && !forcecolor_friend)
                {
                        // only enemy color is forced?
                        // verify it is not equal to the friend color
@@ -279,7 +286,7 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
                                forcecolor_enemy = 0;
                }
 
-               if(forcecolor_friend && !forcecolor_enemy)
+               if(!ISGAMETYPE(BR) && forcecolor_friend && !forcecolor_enemy)
                {
                        // only friend color is forced?
                        // verify it is not equal to the enemy color
@@ -292,7 +299,7 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
                                        forcecolor_friend = 0;
                }
 
-               if(cm == 1024 + 17 * myteam)
+               if((!ISGAMETYPE(BR) && (cm == 1024 + 17 * myteam)) || (ISGAMETYPE(BR) && br_isSameSquad(this.entnum)))
                {
                        if(forcecolor_friend)
                                this.colormap = forcecolor_friend;