Fix a crash in K_drawBossHealthBar exposed by the new random functions
This commit is contained in:
parent
04e99590e1
commit
631d9b4454
1 changed files with 7 additions and 3 deletions
10
src/k_hud.c
10
src/k_hud.c
|
|
@ -2036,7 +2036,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)
|
||||
|
|
@ -2082,7 +2082,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.
|
||||
|
|
@ -2097,7 +2099,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…
Reference in a new issue