mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 03:12:00 -04:00
de-obfuscate largeammo value, properly initialize ammo widget in ST_createWidgets() (#1633)
This commit is contained in:
parent
a1c804c064
commit
42d9bbfd17
@ -112,7 +112,7 @@ static void STlib_drawNum
|
||||
}
|
||||
|
||||
// if non-number, do not draw it
|
||||
if (num == 1994)
|
||||
if (num == LARGENUMBER)
|
||||
return;
|
||||
|
||||
//jff 2/16/98 add color translation to digit output
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
#define LARGENUMBER 1994
|
||||
|
||||
// We are referring to patches.
|
||||
struct patch_s;
|
||||
|
||||
|
@ -730,9 +730,10 @@ int ST_BlinkKey(player_t* player, int index)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int largeammo = LARGENUMBER; // means "n/a"
|
||||
|
||||
void ST_updateWidgets(void)
|
||||
{
|
||||
static int largeammo = 1994; // means "n/a"
|
||||
int i;
|
||||
|
||||
// must redirect the pointer if the ready weapon has changed.
|
||||
@ -1221,6 +1222,9 @@ void ST_createWidgets(void)
|
||||
// the last weapon type
|
||||
w_ready.data = plyr->readyweapon;
|
||||
|
||||
if (weaponinfo[plyr->readyweapon].ammo == am_noammo)
|
||||
w_ready.num = &largeammo;
|
||||
|
||||
// health percentage
|
||||
STlib_initPercent(&w_health,
|
||||
ST_HEALTHX - distributed_delta,
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "mn_menu.h"
|
||||
#include "r_defs.h"
|
||||
#include "s_sound.h"
|
||||
#include "st_lib.h"
|
||||
#include "sounds.h"
|
||||
#include "u_mapinfo.h"
|
||||
#include "v_video.h"
|
||||
@ -767,7 +768,7 @@ WI_drawNum
|
||||
}
|
||||
|
||||
// if non-number, do not draw it
|
||||
if (n == 1994)
|
||||
if (n == LARGENUMBER)
|
||||
return 0;
|
||||
|
||||
// draw the new number
|
||||
|
Loading…
x
Reference in New Issue
Block a user