mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-22 21:41:31 +00:00
Fix a crash in K_drawBossHealthBar exposed by the new random functions
This commit is contained in:
parent
17dd15b998
commit
8bb29e340c
1 changed files with 7 additions and 3 deletions
10
src/k_hud.c
10
src/k_hud.c
|
|
@ -1973,7 +1973,7 @@ static void K_drawBossHealthBar(void)
|
|||
UINT8 i = 0, barstatus = 1, randlen = 0, darken = 0;
|
||||
const INT32 startx = BASEVIDWIDTH - 23;
|
||||
INT32 starty = BASEVIDHEIGHT - 25;
|
||||
INT32 rolrand = 0;
|
||||
INT32 rolrand = 0, randtemp = 0;
|
||||
boolean randsign = false;
|
||||
|
||||
if (bossinfo.barlen <= 1)
|
||||
|
|
@ -2019,7 +2019,9 @@ static void K_drawBossHealthBar(void)
|
|||
barstatus = 2;
|
||||
}
|
||||
|
||||
randlen = M_RandomKey(bossinfo.visualbar-(bossinfo.visualdiv/(2*FRACUNIT)))+1;
|
||||
randtemp = bossinfo.visualbar-(bossinfo.visualdiv/(2*FRACUNIT));
|
||||
if (randtemp > 0)
|
||||
randlen = M_RandomKey(randtemp)+1;
|
||||
randsign = M_RandomChance(FRACUNIT/2);
|
||||
|
||||
// Right wing.
|
||||
|
|
@ -2034,7 +2036,9 @@ static void K_drawBossHealthBar(void)
|
|||
randlen--;
|
||||
if (!randlen)
|
||||
{
|
||||
randlen = M_RandomKey(bossinfo.visualbar-(bossinfo.visualdiv/(2*FRACUNIT)))+1;
|
||||
randtemp = bossinfo.visualbar-(bossinfo.visualdiv/(2*FRACUNIT));
|
||||
if (randtemp > 0)
|
||||
randlen = M_RandomKey(randtemp)+1;
|
||||
if (barstatus > 1)
|
||||
{
|
||||
rolrand = M_RandomKey(barstatus)+1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue