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