mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Fix sprite2 fallbacks.
It didn't work at all before, oops. :/
This commit is contained in:
parent
d2ef4d3e3c
commit
8a261ea467
2 changed files with 16 additions and 11 deletions
18
src/p_mobj.c
18
src/p_mobj.c
|
@ -295,15 +295,9 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
|
|||
boolean noalt = false;
|
||||
UINT8 spr2 = st->frame & FF_FRAMEMASK;
|
||||
UINT16 frame = (mobj->frame & FF_FRAMEMASK)+1;
|
||||
if (mobj->sprite != SPR_PLAY)
|
||||
{
|
||||
mobj->sprite = SPR_PLAY;
|
||||
frame = 0;
|
||||
}
|
||||
else if (mobj->sprite2 != spr2)
|
||||
frame = 0;
|
||||
|
||||
while (&((skin_t *)mobj->skin)->sprites[spr2].numframes == 0 && spr2 != SPR2_STND)
|
||||
while (((skin_t *)mobj->skin)->sprites[spr2].numframes <= 0
|
||||
&& spr2 != SPR2_STND)
|
||||
{
|
||||
switch(spr2)
|
||||
{
|
||||
|
@ -398,6 +392,14 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
|
|||
break;
|
||||
}
|
||||
|
||||
if (mobj->sprite != SPR_PLAY)
|
||||
{
|
||||
mobj->sprite = SPR_PLAY;
|
||||
frame = 0;
|
||||
}
|
||||
else if (mobj->sprite2 != spr2)
|
||||
frame = 0;
|
||||
|
||||
mobj->sprite2 = spr2;
|
||||
if (!mobj->skin || frame >= ((skin_t *)mobj->skin)->sprites[spr2].numframes)
|
||||
frame = 0;
|
||||
|
|
|
@ -3713,9 +3713,12 @@ static void P_DoSpinDash(player_t *player, ticcmd_t *cmd)
|
|||
S_StartSound(player->mo, sfx_spndsh); // Make the rev sound!
|
||||
|
||||
// Now spawn the color thok circle.
|
||||
P_SpawnSpinMobj(player, player->revitem);
|
||||
if (demorecording)
|
||||
G_GhostAddRev();
|
||||
if (player->mo->sprite2 != SPR2_DASH)
|
||||
{
|
||||
P_SpawnSpinMobj(player, player->revitem);
|
||||
if (demorecording)
|
||||
G_GhostAddRev();
|
||||
}
|
||||
}
|
||||
}
|
||||
// If not moving up or down, and travelling faster than a speed of four while not holding
|
||||
|
|
Loading…
Reference in a new issue