Skip to content

Commit

Permalink
fix indicators flashing when invulnerability powerup fades out (#2217)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
fabiangreffrath authored Mar 1, 2025
1 parent 40d4131 commit 0df430a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/hu_crosshair.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
3 changes: 1 addition & 2 deletions src/st_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
7 changes: 7 additions & 0 deletions src/st_stuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check failure on line 69 in src/st_stuff.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

src/st_stuff.h:69:45 [clang-diagnostic-error]

unknown type name 'player_t'
{
return (player->cheats & CF_GODMODE) ||

Check failure on line 71 in src/st_stuff.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

src/st_stuff.h:71:30 [clang-diagnostic-error]

use of undeclared identifier 'CF_GODMODE'
(player->powers[pw_invulnerability] > 4 * 32) ||
(player->powers[pw_invulnerability] & 8);
}

extern boolean palette_changes;

extern struct hudfont_s *stcfnt;
Expand Down

0 comments on commit 0df430a

Please sign in to comment.