X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fteamplay.qc;h=4632866b4886755e7657da57ca2cc95fa3039109;hb=1c9d0b4994d43c970e3fa02f651b5f5d79765e5b;hp=a1ff864664672ccf1d0877bd78252504e9e4dd27;hpb=dd9807e08b0aecdeeaa74ee49eccabddcd6d630d;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index a1ff86466..4632866b4 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -1,6 +1,6 @@ #include "teamplay.qh" -#include "cl_client.qh" +#include "client.qh" #include "race.qh" #include "scores.qh" #include "scores_rules.qh" @@ -9,10 +9,10 @@ #include "command/vote.qh" -#include "mutators/all.qh" +#include "mutators/_mod.qh" #include "../common/deathtypes/all.qh" -#include "../common/gamemodes/all.qh" +#include "../common/gamemodes/_mod.qh" #include "../common/teams.qh" void TeamchangeFrags(entity e) @@ -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); } } @@ -216,23 +216,23 @@ void SetPlayerTeam(entity pl, float t, float s, float noprint) // set c1...c4 to show what teams are allowed void CheckAllowedTeams (entity for_whom) { - int dm = 0; + int teams_mask = 0; c1 = c2 = c3 = c4 = -1; cb1 = cb2 = cb3 = cb4 = 0; string teament_name = string_null; - bool mutator_returnvalue = MUTATOR_CALLHOOK(GetTeamCount, dm, teament_name); - dm = M_ARGV(0, float); + bool mutator_returnvalue = MUTATOR_CALLHOOK(CheckAllowedTeams, teams_mask, teament_name); + teams_mask = M_ARGV(0, float); teament_name = M_ARGV(1, string); if(!mutator_returnvalue) { - if(dm & BIT(0)) c1 = 0; - if(dm & BIT(1)) c2 = 0; - if(dm & BIT(2)) c3 = 0; - if(dm & BIT(3)) c4 = 0; + if(teams_mask & BIT(0)) c1 = 0; + if(teams_mask & BIT(1)) c2 = 0; + if(teams_mask & BIT(2)) c3 = 0; + if(teams_mask & BIT(3)) c4 = 0; } // find out what teams are allowed if necessary @@ -508,13 +508,13 @@ float FindSmallestTeam(entity pl, float ignore_pl) // now t is the minimum, or A minimum! if(t == 1 || TeamSmallerEqThanTeam(1, t, pl)) - RandomSelection_Add(NULL, 1, string_null, 1, 1); + RandomSelection_AddFloat(1, 1, 1); if(t == 2 || TeamSmallerEqThanTeam(2, t, pl)) - RandomSelection_Add(NULL, 2, string_null, 1, 1); + RandomSelection_AddFloat(2, 1, 1); if(t == 3 || TeamSmallerEqThanTeam(3, t, pl)) - RandomSelection_Add(NULL, 3, string_null, 1, 1); + RandomSelection_AddFloat(3, 1, 1); if(t == 4 || TeamSmallerEqThanTeam(4, t, pl)) - RandomSelection_Add(NULL, 4, string_null, 1, 1); + RandomSelection_AddFloat(4, 1, 1); return RandomSelection_chosen_float; } @@ -552,7 +552,7 @@ int JoinBestTeam(entity this, bool only_return_best, bool forcebestteam) SetPlayerColors(this, selectedteam - 1); // when JoinBestTeam is called by client.qc/ClientKill_Now_TeamChange the players team is -1 and thus skipped - // when JoinBestTeam is called by cl_client.qc/ClientConnect the player_id is 0 the log attempt is rejected + // when JoinBestTeam is called by client.qc/ClientConnect the player_id is 0 the log attempt is rejected LogTeamchange(this.playerid, this.team, 99); } return selectedteam;