diff --git a/src/p_user.c b/src/p_user.c index 9ede28f96..052018c1e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9435,7 +9435,7 @@ void P_PlayerThink(player_t *player) exiting++; } - if (((4*exiting)/total) >= cv_playersforexit.value) + if (!total || ((4*exiting)/total) >= cv_playersforexit.value) { if (server) SendNetXCmd(XD_EXITLEVEL, NULL, 0); diff --git a/src/st_stuff.c b/src/st_stuff.c index 7a49b0402..33192eedb 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -2013,9 +2013,12 @@ static void ST_overlayDrawer(void) exiting++; } - total *= cv_playersforexit.value; - if (total % 4) total += 4; // round up - total /= 4; + if (cv_playersforexit.value != 4) + { + total *= cv_playersforexit.value; + if (total % 4) total += 4; // round up + total /= 4; + } if (exiting >= total) ;