mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-19 07:51:43 +00:00
Two fixes to playersforexit changes.
* Crash prevention if total somehow becomes zero. * Don't waste time multiplying and demultiplying the HUD check if it's just gonna net you the same number.
This commit is contained in:
parent
b197dcdb1f
commit
317259a459
2 changed files with 7 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
;
|
||||
|
|
Loading…
Reference in a new issue