summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2018-11-17 13:33:28 +0100
committerPaweł Redman <pawel.redman@gmail.com>2019-02-10 14:47:47 +0100
commit8238c404708333ee8832ea7538e225086549815d (patch)
treed029ea9e396c2048295f12b97476e6cf6155955d /src
parent24efcdc6cb6a722c4bc1ce28c71833771adc46b9 (diff)
Fix handicap not always resetting as expected.
Diffstat (limited to 'src')
-rw-r--r--src/game/g_main.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c
index e1eb7c3..89f1f3a 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -2723,14 +2723,15 @@ static void CheckAntistack(void)
const char *log_notice = "";
float teambias = 0.0f, scorebias = 0.0f, bias, handicap = 0.0f;
- if (!g_antistack.integer || level.intermissiontime)
+ if (!g_antistack.integer || level.intermissiontime) {
+ level.alienHandicap = 1.0f;
+ level.humanHandicap = 1.0f;
return;
+ }
if (level.time < level.antistackNextCheck)
return;
- level.antistackWasHandicapping = qfalse;
-
for (int i = 0; i < level.maxclients; i++) {
gclient_t *client = level.clients + i;
int score;
@@ -2757,20 +2758,21 @@ static void CheckAntistack(void)
if (aliens + humans < g_antistackPlayerThreshold.integer) {
log_notice = " (too few players)";
bias = 0.0f;
- goto out;
+ goto skip_bias;
}
if (alien_score < g_antistackScoreThreshold.integer &&
human_score < g_antistackScoreThreshold.integer) {
log_notice = " (too little score)";
bias = 0.0f;
- goto out;
+ goto skip_bias;
}
teambias = AntistackTeamBias(aliens, humans);
scorebias = AntistackScoreBias(alien_score, human_score);
bias = teambias + scorebias;
+skip_bias:
if (fabs(bias) < g_antistackBiasThreshold.value) {
log_notice = " (too little bias)";
bias = 0.0f;
@@ -2784,7 +2786,8 @@ static void CheckAntistack(void)
level.alienHandicap = 1.0f;
level.humanHandicap = 1.0f;
- goto out;
+ level.antistackWasHandicapping = qfalse;
+ goto skip_handicap;
}
level.antistackWasHandicapping = qtrue;
@@ -2816,7 +2819,7 @@ static void CheckAntistack(void)
level.humanHandicap = 1.0f;
}
-out:
+skip_handicap:
G_LogPrintf("Antistack: %dv%d %d:%d %f %f %f %i %f%s\n",
aliens, humans, alien_score, human_score, teambias,
scorebias, bias, handicap_team, handicap, log_notice);