Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Aug 27, 2024
1 parent 0b128e5 commit d3cc2dd
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/hu_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,17 @@ void HU_Init(void)

for (int i = 0; i < NUMWEAPONS; i++)
{
int ammothing = weaponinfo[i].ammothing;
int spawnstate = mobjinfo[ammothing].spawnstate;
int sprite = states[spawnstate].sprite;
int frame = states[spawnstate].frame;
int lumpnum = firstspritelump + sprites[sprite].spriteframes[frame].lump[0];
const int ammothing = weaponinfo[i].ammothing;

weaponinfo[i].ammopatch = W_CacheLumpNum(lumpnum);
if (ammothing == MT_NULL || !(mobjinfo[ammothing].flags & MF_SPECIAL))
weaponinfo[i].ammopatch = NULL;
else
{
state_t *state = &states[mobjinfo[ammothing].spawnstate];

weaponinfo[i].ammopatch = W_CacheLumpNum(firstspritelump
+ sprites[state->sprite].spriteframes[state->frame].lump[0]);
}
}

keypics[it_bluecard].patch = HU_LoadHUDKeyPatch(it_bluecard);
Expand Down

0 comments on commit d3cc2dd

Please sign in to comment.