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>2018-11-18 00:10:42 +0100
commit91a67d68b5788f97c075bce8db1e59c73340589e (patch)
treed58f749a36b76acc1ca8dd7a8d7e354c4108e062 /src
parentb613d50e14af12d5e882fcdab32b67a794dd0a04 (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)