From: Mario Date: Sun, 21 Aug 2016 03:05:19 +0000 (+1000) Subject: Redefine setcolor X-Git-Tag: xonotic-v0.8.2~687^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=597ff9a74ab42a5bf26db9729bd86a7dc2b37efc;p=xonotic%2Fxonotic-data.pk3dir.git Redefine setcolor --- diff --git a/qcsrc/dpdefs/post.qh b/qcsrc/dpdefs/post.qh index 9419dceea..16fd93450 100644 --- a/qcsrc/dpdefs/post.qh +++ b/qcsrc/dpdefs/post.qh @@ -8,6 +8,7 @@ #undef objerror #undef remove #undef walkmove +#undef setcolor #ifdef MENUQC #define NULL (0, null_entity) diff --git a/qcsrc/dpdefs/pre.qh b/qcsrc/dpdefs/pre.qh index 801b8731b..63cebbc1a 100644 --- a/qcsrc/dpdefs/pre.qh +++ b/qcsrc/dpdefs/pre.qh @@ -8,3 +8,4 @@ #define objerror builtin_objerror #define remove builtin_remove #define walkmove builtin_walkmove +#define setcolor builtin_setcolor diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/default/bot.qc index 8ee00e7d5..cab38143d 100644 --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@ -224,7 +224,7 @@ void bot_setnameandstuff(entity this) this.bot_config_loaded = true; // this is really only a default, JoinBestTeam is called later - set_color(this, stof(bot_shirt) * 16 + stof(bot_pants)); + setcolor(this, stof(bot_shirt) * 16 + stof(bot_pants)); this.bot_preferredcolors = this.clientcolors; // pick the name @@ -340,7 +340,7 @@ void bot_endgame() e = bot_list; while (e) { - set_color(e, e.bot_preferredcolors); + setcolor(e, e.bot_preferredcolors); e = e.nextbot; } // if dynamic waypoints are ever implemented, save them here diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 85bfd4eb6..0a608e979 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -471,7 +471,7 @@ void FixPlayermodel(entity player) if(!teamplay) if(strlen(autocvar_sv_defaultplayercolors)) if(player.clientcolors != stof(autocvar_sv_defaultplayercolors)) - set_color(player, stof(autocvar_sv_defaultplayercolors)); + setcolor(player, stof(autocvar_sv_defaultplayercolors)); } diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index a1ff86466..9af668f14 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -158,13 +158,13 @@ string getwelcomemessage(entity this) return s; } -void set_color(entity this, int clr) +void setcolor(entity this, int clr) { #if 0 this.clientcolors = clr; this.team = (clr & 15) + 1; #else - setcolor(this, clr); + builtin_setcolor(this, clr); #endif } @@ -183,9 +183,9 @@ void SetPlayerColors(entity pl, float _color) if(teamplay) { - set_color(pl, 16*pants + pants); + setcolor(pl, 16*pants + pants); } else { - set_color(pl, shirt + pants); + setcolor(pl, shirt + pants); } } diff --git a/qcsrc/server/teamplay.qh b/qcsrc/server/teamplay.qh index f34c6d59d..127ac7a6d 100644 --- a/qcsrc/server/teamplay.qh +++ b/qcsrc/server/teamplay.qh @@ -50,3 +50,5 @@ int JoinBestTeam(entity this, bool only_return_best, bool forcebestteam); //void() ctf_playerchanged; void ShufflePlayerOutOfTeam (float source_team); + +void setcolor(entity this, int clr);