From 55b9deeaad19402e3f7618efea325682b2cda7dc Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Tue, 20 Nov 2018 21:01:29 +0100 Subject: Avoid indeterminate forms in calculations. --- src/game/g_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/game/g_main.c b/src/game/g_main.c index 94d664e..dfa45ab 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -2722,7 +2722,11 @@ static float AntistackScoreBias(int alien_score, int human_score) if (fabsf(bias) < g_antistackScoreBiasThreshold.value) return 0.0f; - return bias * g_antistackScoreBiasFactor.value; + bias *= g_antistackScoreBiasFactor.value;; + if (isnanf(bias)) // ±inf * 0 + return 0.0f; + + return bias; } static void CheckAntistack(void) -- cgit