Skip to content

Commit

Permalink
Better handling of super shotgun hack
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Feb 1, 2014
1 parent 05929a1 commit 3cc9fc3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/p_pspr.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,10 @@ void P_SetPsprite(player_t *player, int position, statenum_t stnum)
break;
}

supershotgun = (stnum >= S_DSGUN && stnum <= S_DSGUNUP);

stnum = psp->state->nextstate;

} while (!psp->tics);
}
while (!psp->tics);
// an initial state of 0 could cycle through
}

Expand Down
12 changes: 7 additions & 5 deletions src/r_things.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ void R_DrawVisSprite(vissprite_t *vis, int x1, int x2, boolean psprite)
R_DrawMaskedColumn2(column);
}

supershotgun = false;
//supershotgun = false;

colfunc = basecolfunc;
}
Expand Down Expand Up @@ -591,14 +591,14 @@ void R_ProjectSprite(mobj_t *thing)

// calculate edges of the shape
tx -= (flip ? spritewidth[lump] - spriteoffset[lump] : spriteoffset[lump]);
x1 = (centerxfrac + FRACUNIT/2 + FixedMul(tx, xscale)) >> FRACBITS;
x1 = (centerxfrac + FRACUNIT / 2 + FixedMul(tx, xscale)) >> FRACBITS;

// off the right side?
if (x1 > viewwidth)
return;

tx += spritewidth[lump];
x2 = ((centerxfrac + FRACUNIT/2 + FixedMul(tx, xscale)) >> FRACBITS) - 1;
x2 = ((centerxfrac + FRACUNIT / 2 + FixedMul(tx, xscale)) >> FRACBITS) - 1;

// off the left side
if (x2 < 0)
Expand Down Expand Up @@ -791,7 +791,7 @@ void R_DrawPSprite(pspdef_t *psp)
}
else
{
if (flash || psp->state->frame & FF_FULLBRIGHT)
if (flash || (state->frame & FF_FULLBRIGHT))
{
// full bright
vis->colormap = colormaps;
Expand All @@ -809,9 +809,11 @@ void R_DrawPSprite(pspdef_t *psp)
}

if (flash)
vis->mobjflags2 |= flags2[psp->state->sprite];
vis->mobjflags2 |= flags2[state->sprite];

supershotgun = (state == &states[S_DSGUN]);
R_DrawVisSprite(vis, vis->x1, vis->x2, screenblocks >= 10);
supershotgun = false;
}


Expand Down

0 comments on commit 3cc9fc3

Please sign in to comment.