]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix cl_forceplayercolors 3; also improve cl_forceplayercolors description
authorterencehill <piuntn@gmail.com>
Mon, 19 Apr 2021 12:32:40 +0000 (14:32 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 19 Apr 2021 12:32:40 +0000 (14:32 +0200)
qcsrc/client/csqcmodel_hooks.qc
qcsrc/common/mapinfo.qh
xonotic-client.cfg

index 4c16176996b6f54e0bddfd27849f6da8f421bfc7..0b38b108bdc5e8c63a57c1fb86ac300f0f80e584 100644 (file)
@@ -244,8 +244,7 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
 
                if(autocvar_cl_forcemyplayercolors)
                        forcecolor_friend = 1024 + autocvar_cl_forcemyplayercolors;
 
                if(autocvar_cl_forcemyplayercolors)
                        forcecolor_friend = 1024 + autocvar_cl_forcemyplayercolors;
-               if((autocvar_cl_forceplayercolors == 2 && team_count == 2)
-                       || (autocvar_cl_forceplayercolors == 3 && IS_GAMETYPE(DUEL)))
+               if(autocvar_cl_forceplayercolors != 3 && autocvar_cl_forceplayercolors == 2 && team_count == 2)
                        forcecolor_enemy = 1024 + autocvar__cl_color;
 
                if(forcecolor_enemy && !forcecolor_friend)
                        forcecolor_enemy = 1024 + autocvar__cl_color;
 
                if(forcecolor_enemy && !forcecolor_friend)
@@ -284,7 +283,7 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
        {
                if(autocvar_cl_forcemyplayercolors && islocalplayer)
                        this.colormap = 1024 + autocvar_cl_forcemyplayercolors;
        {
                if(autocvar_cl_forcemyplayercolors && islocalplayer)
                        this.colormap = 1024 + autocvar_cl_forcemyplayercolors;
-               else if(autocvar_cl_forceplayercolors)
+               else if(autocvar_cl_forceplayercolors && (autocvar_cl_forceplayercolors != 3 || ISGAMETYPE(DUEL)))
                        this.colormap = player_localnum + 1;
        }
 
                        this.colormap = player_localnum + 1;
        }
 
index be1a4ef7c686dd8bb7861b8edb764ff4cbac3c3f..0ac0c6230548692303cf5c685cdd10dddbb6f882 100644 (file)
@@ -126,7 +126,10 @@ REGISTRY_DEFINE_GET(Gametypes, NULL)
 STATIC_INIT(Gametypes_renumber) { FOREACH(Gametypes, true, it.m_id = i); }
 #define REGISTER_GAMETYPE(NAME, inst) REGISTER(Gametypes, MAPINFO_TYPE, NAME, m_id, inst)
 
 STATIC_INIT(Gametypes_renumber) { FOREACH(Gametypes, true, it.m_id = i); }
 #define REGISTER_GAMETYPE(NAME, inst) REGISTER(Gametypes, MAPINFO_TYPE, NAME, m_id, inst)
 
+#ifndef CSQC
+// NOTE: ISGAMETYPE in csqc (temporary hack)
 #define IS_GAMETYPE(NAME) (MapInfo_LoadedGametype == MAPINFO_TYPE_##NAME)
 #define IS_GAMETYPE(NAME) (MapInfo_LoadedGametype == MAPINFO_TYPE_##NAME)
+#endif
 
 const int MAPINFO_FEATURE_WEAPONS       = 1; // not defined for instagib-only maps
 const int MAPINFO_FEATURE_VEHICLES      = 2;
 
 const int MAPINFO_FEATURE_WEAPONS       = 1; // not defined for instagib-only maps
 const int MAPINFO_FEATURE_VEHICLES      = 2;
index bfae64fff1b848ba039f82dd5c0061da03fd422f..f5204648527d640b4eca0d63350265966eb99c68 100644 (file)
@@ -753,7 +753,7 @@ set cl_accuracy_data_receive 0 "1 receive weapon accuracy data statistics at the
 set developer_csqcentities 0 "csqc entity spam"
 
 seta cl_forceplayermodels 0 "make everyone look like your own model (requires server to have sv_defaultcharacter 0)"
 set developer_csqcentities 0 "csqc entity spam"
 
 seta cl_forceplayermodels 0 "make everyone look like your own model (requires server to have sv_defaultcharacter 0)"
-seta cl_forceplayercolors 0 "make enemies look like your own color (requires server to have sv_defaultcharacter 0); 2: enable it even in teamplay (only when there is exactly one enemy team); 3: enable it only playing Duel"
+seta cl_forceplayercolors 0 "make enemies look like your own color (requires server to have sv_defaultcharacter 0); 1: in all game modes without teams, 2: even in game modes with 2 teams, 3: only in Duel"
 seta cl_forcemyplayermodel "" "set to the model file name you want to show yourself as (does not affect how enemies look with cl_forceplayermodels)"
 seta cl_forcemyplayerskin 0 "set to the skin number you want to show yourself as (does not affect how enemies look with cl_forceplayermodels)"
 seta cl_forcemyplayercolors 0 "set to the color value (encoding is same as _cl_color) for your own player model (ignored in teamplay; does not affect how enemies look with cl_forceplayermodels)"
 seta cl_forcemyplayermodel "" "set to the model file name you want to show yourself as (does not affect how enemies look with cl_forceplayermodels)"
 seta cl_forcemyplayerskin 0 "set to the skin number you want to show yourself as (does not affect how enemies look with cl_forceplayermodels)"
 seta cl_forcemyplayercolors 0 "set to the color value (encoding is same as _cl_color) for your own player model (ignored in teamplay; does not affect how enemies look with cl_forceplayermodels)"