mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-19 16:01:35 +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++;
|
exiting++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((4*exiting)/total) >= cv_playersforexit.value)
|
if (!total || ((4*exiting)/total) >= cv_playersforexit.value)
|
||||||
{
|
{
|
||||||
if (server)
|
if (server)
|
||||||
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
|
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
|
||||||
|
|
|
@ -2013,9 +2013,12 @@ static void ST_overlayDrawer(void)
|
||||||
exiting++;
|
exiting++;
|
||||||
}
|
}
|
||||||
|
|
||||||
total *= cv_playersforexit.value;
|
if (cv_playersforexit.value != 4)
|
||||||
if (total % 4) total += 4; // round up
|
{
|
||||||
total /= 4;
|
total *= cv_playersforexit.value;
|
||||||
|
if (total % 4) total += 4; // round up
|
||||||
|
total /= 4;
|
||||||
|
}
|
||||||
|
|
||||||
if (exiting >= total)
|
if (exiting >= total)
|
||||||
;
|
;
|
||||||
|
|
Loading…
Reference in a new issue