X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Ft_items.qc;h=8940eaaf736e527160c0071f243f7a0ada36ee8e;hp=8be48b53001a313cfb40ad288bb3401430df40b8;hb=073cc17f87486bec59ac2b6f9c26bf1155dbd7d8;hpb=033d44f4bc134eae5f0d65f75d1807159d6042cd diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 8be48b530..8940eaaf7 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -613,14 +613,18 @@ float adjust_respawntime(float normal_respawntime) { return normal_respawntime; } - CheckAllowedTeams(NULL); - GetTeamCounts(NULL); + entity balance = TeamBalance_CheckAllowedTeams(NULL); + TeamBalance_GetTeamCounts(balance, NULL); int players = 0; - if (c1 != -1) players += c1; - if (c2 != -1) players += c2; - if (c3 != -1) players += c3; - if (c4 != -1) players += c4; - + for (int i = 1; i <= NUM_TEAMS; ++i) + { + if (TeamBalance_IsTeamAllowed(balance, i)) + { + players += TeamBalance_GetNumberOfPlayers(balance, i); + } + } + TeamBalance_Destroy(balance); + if (players >= 2) { return normal_respawntime * (r / (players + o) + l); } else {