X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fplayer.qc;h=e41bf931b7cf1d1402fcf74aedad0aca9d4193f7;hp=4e8663d24af0a5aaf8b6b3f574fdd9acd9dab8d8;hb=acf114225f94bed609c10c74e1bb1277d28a7419;hpb=f28bafd2da379d00bd179459e73a77620552a66f diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index 4e8663d24..e41bf931b 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -235,10 +235,10 @@ void calculate_player_respawn_time(entity this) float pcount = 1; // Include myself whether or not team is already set right and I'm a "player". if (teamplay) { - FOREACH_CLIENT(IS_PLAYER(it) && it != this, LAMBDA( + FOREACH_CLIENT(IS_PLAYER(it) && it != this, { if(it.team == this.team) ++pcount; - )); + }); if (sdelay_small_count == 0) sdelay_small_count = 1; if (sdelay_large_count == 0) @@ -246,9 +246,9 @@ void calculate_player_respawn_time(entity this) } else { - FOREACH_CLIENT(IS_PLAYER(it) && it != this, LAMBDA( + FOREACH_CLIENT(IS_PLAYER(it) && it != this, { ++pcount; - )); + }); if (sdelay_small_count == 0) { if (IS_INDEPENDENT_PLAYER(this)) @@ -667,15 +667,19 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, } } -void MoveToTeam(entity client, int team_colour, int type) +bool MoveToTeam(entity client, int team_colour, int type) { int lockteams_backup = lockteams; // backup any team lock lockteams = 0; // disable locked teams TeamchangeFrags(client); // move the players frags - SetPlayerColors(client, team_colour - 1); // set the players colour + if (!SetPlayerTeamSimple(client, team_colour)) + { + return false; + } Damage(client, client, client, 100000, DEATH_AUTOTEAMCHANGE.m_id, client.origin, '0 0 0'); // kill the player lockteams = lockteams_backup; // restore the team lock LogTeamchange(client.playerid, client.team, type); + return true; } /** print(), but only print if the server is not local */