Replace hacky flag abuse with timer (which can be used later when developing pushing sprites).

This commit is contained in:
toasterbabe 2017-02-06 20:36:21 +00:00
parent 61ec599830
commit 0e40299f3e
4 changed files with 6 additions and 3 deletions

View File

@ -241,6 +241,7 @@ typedef enum
pw_underwater, // underwater timer
pw_spacetime, // In space, no one can hear you spin!
pw_extralife, // Extra Life timer
pw_pushing,
pw_super, // Are you super?
pw_gravityboots, // gravity boots

View File

@ -7118,6 +7118,7 @@ static const char *const POWERS_LIST[] = {
"UNDERWATER", // underwater timer
"SPACETIME", // In space, no one can hear you spin!
"EXTRALIFE", // Extra Life timer
"PUSHING",
"SUPER", // Are you super?
"GRAVITYBOOTS", // gravity boots

View File

@ -2190,7 +2190,7 @@ void P_XYMovement(mobj_t *mo)
P_SlideMove(mo);
if (player)
mo->flags |= MF_SLIDEME;
player->powers[pw_pushing] = 3;
xmove = ymove = 0;
#ifdef ESLOPE

View File

@ -9229,7 +9229,7 @@ void P_PlayerThink(player_t *player)
else if (cmd->forwardmove || cmd->sidemove) // only when you're pressing movement keys
{
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->drawangle = player->mo->angle + R_PointToAngle2(0, 0, cmd->forwardmove<<FRACBITS, -cmd->sidemove<<FRACBITS);
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.
// Unset statis flags after moving.