mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 11:22:18 -04:00
fix indicators flashing when invulnerability powerup fades out (#2217)
* fix indicators flashing when invulnerability powerup fades out https://www.doomworld.com/forum/topic/112333-this-is-woof-1520-jan-31-2025/?page=106&tab=comments#comment-2902657 * use player_t instead of struct player_s
This commit is contained in:
parent
40d413183c
commit
0df430ad78
@ -130,7 +130,7 @@ void HU_UpdateCrosshair(void)
|
||||
crosshair.y = (screenblocks <= 10) ? (SCREENHEIGHT - ST_HEIGHT) / 2
|
||||
: SCREENHEIGHT / 2;
|
||||
|
||||
boolean invul = (plr->cheats & CF_GODMODE) || plr->powers[pw_invulnerability];
|
||||
boolean invul = ST_PlayerInvulnerable(plr);
|
||||
|
||||
if (hud_crosshair_health)
|
||||
{
|
||||
|
@ -880,8 +880,7 @@ static void UpdateBoomColors(sbarelem_t *elem, player_t *player)
|
||||
|
||||
sbe_number_t *number = elem->subtype.number;
|
||||
|
||||
boolean invul = (player->powers[pw_invulnerability]
|
||||
|| player->cheats & CF_GODMODE);
|
||||
boolean invul = ST_PlayerInvulnerable(player);
|
||||
|
||||
crange_idx_e cr;
|
||||
|
||||
|
@ -66,6 +66,13 @@ extern int health_red; // health amount less than which status is red
|
||||
extern int health_yellow; // health amount less than which status is yellow
|
||||
extern int health_green; // health amount above is blue, below is green
|
||||
|
||||
static inline boolean ST_PlayerInvulnerable(player_t *player)
|
||||
{
|
||||
return (player->cheats & CF_GODMODE) ||
|
||||
(player->powers[pw_invulnerability] > 4 * 32) ||
|
||||
(player->powers[pw_invulnerability] & 8);
|
||||
}
|
||||
|
||||
extern boolean palette_changes;
|
||||
|
||||
extern struct hudfont_s *stcfnt;
|
||||
|
Loading…
x
Reference in New Issue
Block a user