Replace hacky flag abuse with timer (which can be used later when developing pushing sprites).
This commit is contained in:
parent
61ec599830
commit
0e40299f3e
|
@ -241,6 +241,7 @@ typedef enum
|
||||||
pw_underwater, // underwater timer
|
pw_underwater, // underwater timer
|
||||||
pw_spacetime, // In space, no one can hear you spin!
|
pw_spacetime, // In space, no one can hear you spin!
|
||||||
pw_extralife, // Extra Life timer
|
pw_extralife, // Extra Life timer
|
||||||
|
pw_pushing,
|
||||||
|
|
||||||
pw_super, // Are you super?
|
pw_super, // Are you super?
|
||||||
pw_gravityboots, // gravity boots
|
pw_gravityboots, // gravity boots
|
||||||
|
|
|
@ -7118,6 +7118,7 @@ static const char *const POWERS_LIST[] = {
|
||||||
"UNDERWATER", // underwater timer
|
"UNDERWATER", // underwater timer
|
||||||
"SPACETIME", // In space, no one can hear you spin!
|
"SPACETIME", // In space, no one can hear you spin!
|
||||||
"EXTRALIFE", // Extra Life timer
|
"EXTRALIFE", // Extra Life timer
|
||||||
|
"PUSHING",
|
||||||
|
|
||||||
"SUPER", // Are you super?
|
"SUPER", // Are you super?
|
||||||
"GRAVITYBOOTS", // gravity boots
|
"GRAVITYBOOTS", // gravity boots
|
||||||
|
|
|
@ -2190,7 +2190,7 @@ void P_XYMovement(mobj_t *mo)
|
||||||
|
|
||||||
P_SlideMove(mo);
|
P_SlideMove(mo);
|
||||||
if (player)
|
if (player)
|
||||||
mo->flags |= MF_SLIDEME;
|
player->powers[pw_pushing] = 3;
|
||||||
xmove = ymove = 0;
|
xmove = ymove = 0;
|
||||||
|
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
|
|
|
@ -9229,7 +9229,7 @@ void P_PlayerThink(player_t *player)
|
||||||
else if (cmd->forwardmove || cmd->sidemove) // only when you're pressing movement keys
|
else if (cmd->forwardmove || cmd->sidemove) // only when you're pressing movement keys
|
||||||
{
|
{
|
||||||
if ((player->mo->movefactor < FRACUNIT) // hilarious absence of traction!
|
if ((player->mo->movefactor < FRACUNIT) // hilarious absence of traction!
|
||||||
|| (player->mo->flags & MF_SLIDEME)
|
|| (player->powers[pw_pushing])
|
||||||
|| !(player->rmomx || player->rmomy)) // adjust to new angle
|
|| !(player->rmomx || player->rmomy)) // adjust to new angle
|
||||||
player->drawangle = player->mo->angle + R_PointToAngle2(0, 0, cmd->forwardmove<<FRACBITS, -cmd->sidemove<<FRACBITS);
|
player->drawangle = player->mo->angle + R_PointToAngle2(0, 0, cmd->forwardmove<<FRACBITS, -cmd->sidemove<<FRACBITS);
|
||||||
else
|
else
|
||||||
|
@ -9237,7 +9237,8 @@ void P_PlayerThink(player_t *player)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
player->mo->flags &= ~MF_SLIDEME;
|
if (player->powers[pw_pushing])
|
||||||
|
player->powers[pw_pushing]--;
|
||||||
player->mo->movefactor = FRACUNIT; // We're not going to do any more with this, so let's change it back for the next frame.
|
player->mo->movefactor = FRACUNIT; // We're not going to do any more with this, so let's change it back for the next frame.
|
||||||
|
|
||||||
// Unset statis flags after moving.
|
// Unset statis flags after moving.
|
||||||
|
|
Loading…
Reference in New Issue