From: terencehill Date: Mon, 19 Apr 2021 12:32:40 +0000 (+0200) Subject: Fix cl_forceplayercolors 3; also improve cl_forceplayercolors description X-Git-Tag: xonotic-v0.8.5~441 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=bb27a7450133e9fb4b11b37f3b38e19ea232ff82 Fix cl_forceplayercolors 3; also improve cl_forceplayercolors description --- diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index 4c16176996..0b38b108bd 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -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_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) @@ -284,7 +283,7 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer) { 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; } diff --git a/qcsrc/common/mapinfo.qh b/qcsrc/common/mapinfo.qh index be1a4ef7c6..0ac0c62305 100644 --- a/qcsrc/common/mapinfo.qh +++ b/qcsrc/common/mapinfo.qh @@ -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) +#ifndef CSQC +// NOTE: ISGAMETYPE in csqc (temporary hack) #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; diff --git a/xonotic-client.cfg b/xonotic-client.cfg index bfae64fff1..f520464852 100644 --- a/xonotic-client.cfg +++ b/xonotic-client.cfg @@ -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)" -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)"