summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2018-11-18 00:10:21 +0100
committerPaweł Redman <pawel.redman@gmail.com>2019-02-10 14:47:47 +0100
commit233cd1b315cebe21bb86b728ba3d7037cfdd8beb (patch)
tree3811ff5c1933e38cb6c84c2e151aeeb1d0b5cfda /src
parentee267d975528dbe3b67b04265ad595ad36f12920 (diff)
Don't reset if the player count drops below the threshold.
Diffstat (limited to 'src')
-rw-r--r--src/game/g_local.h1
-rw-r--r--src/game/g_main.c11
2 files changed, 9 insertions, 3 deletions
diff --git a/src/game/g_local.h b/src/game/g_local.h
index d7c3860..f4961fd 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -834,6 +834,7 @@ typedef struct
int antistackNextCheck;
qboolean antistackWasHandicapping;
+ qboolean antistackHadEnoughPlayers;
float alienHandicap;
float humanHandicap;
} level_locals_t;
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 8f8a83b..c7ad479 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -1026,6 +1026,8 @@ void G_InitGame( int levelTime, int randomSeed, int restart )
level.antistackNextCheck = g_antistackTimeThreshold.integer * 1000;
level.alienHandicap = 1.0f;
level.humanHandicap = 1.0f;
+ level.antistackWasHandicapping = qfalse;
+ level.antistackHadEnoughPlayers = qfalse;
}
/*
@@ -2758,12 +2760,15 @@ static void CheckAntistack(void)
}
}
- if (aliens + humans < g_antistackPlayerThreshold.integer) {
+ if (!level.antistackHadEnoughPlayers &&
+ aliens + humans < g_antistackPlayerThreshold.integer) {
log_notice = " (too few players)";
bias = 0.0f;
goto skip_bias;
}
+ level.antistackHadEnoughPlayers = qtrue;
+
if (alien_score < g_antistackScoreThreshold.integer &&
human_score < g_antistackScoreThreshold.integer) {
log_notice = " (too little score)";
@@ -2777,8 +2782,8 @@ static void CheckAntistack(void)
skip_bias:
if (fabs(bias) < g_antistackBiasThreshold.value) {
- log_notice = " (too little bias)";
- bias = 0.0f;
+ if (!strlen(log_notice))
+ log_notice = " (too little bias)";
if (level.antistackWasHandicapping) {
if (g_antistack.integer > 0)