Skip to content

Commit

Permalink
Fixed All Games: Tiny difference in walk-to-stop mobj momentum thresh…
Browse files Browse the repository at this point in the history
…old compared to original behavior.
  • Loading branch information
danij-deng committed Apr 7, 2010
1 parent e8280a3 commit 2dfb87c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions doomsday/plugins/jdoom/src/p_mobj.c
Expand Up @@ -54,7 +54,7 @@
#define MAX_BOB_OFFSET (8)

#define NOMOMENTUM_THRESHOLD (0.000001f)
#define STOPSPEED (1.0f/1.6/10)
#define WALKSTOP_THRESHOLD (0.062484741f) // FIX2FLT(0x1000-1)
#define DROPOFFMOMENTUM_THRESHOLD (1.0f / 4)

// TYPES -------------------------------------------------------------------
Expand Down Expand Up @@ -338,10 +338,10 @@ void P_MobjMoveXY(mobj_t *mo)
}

// Stop player walking animation.
if(!player || (!(player->plr->cmd.forwardMove | player->plr->cmd.sideMove) &&
player->plr->mo != mo /* $voodoodolls: Stop animating. */) &&
INRANGE_OF(mo->mom[MX], 0, STOPSPEED) &&
INRANGE_OF(mo->mom[MY], 0, STOPSPEED))
if((!player || (!(player->plr->cmd.forwardMove | player->plr->cmd.sideMove) &&
player->plr->mo != mo /* $voodoodolls: Stop animating. */)) &&
INRANGE_OF(mo->mom[MX], 0, WALKSTOP_THRESHOLD) &&
INRANGE_OF(mo->mom[MY], 0, WALKSTOP_THRESHOLD))
{
// If in a walking frame, stop moving.
if(player && isInWalkState(player) && player->plr->mo == mo)
Expand Down
10 changes: 5 additions & 5 deletions doomsday/plugins/jdoom64/src/p_mobj.c
Expand Up @@ -60,7 +60,7 @@
#define MAX_BOB_OFFSET (8)

#define NOMOMENTUM_THRESHOLD (0.000001f)
#define STOPSPEED (1.0f/1.6/10)
#define WALKSTOP_THRESHOLD (0.062484741f) // FIX2FLT(0x1000-1)
#define STANDSPEED (1.0f/2)

// TYPES -------------------------------------------------------------------
Expand Down Expand Up @@ -343,10 +343,10 @@ void P_MobjMoveXY(mobj_t* mo)
}

// Stop player walking animation.
if(!player || (!(player->plr->cmd.forwardMove | player->plr->cmd.sideMove) &&
player->plr->mo != mo /* $voodoodolls: Stop animating. */) &&
INRANGE_OF(mo->mom[MX], 0, STOPSPEED) &&
INRANGE_OF(mo->mom[MY], 0, STOPSPEED))
if((!player || (!(player->plr->cmd.forwardMove | player->plr->cmd.sideMove) &&
player->plr->mo != mo /* $voodoodolls: Stop animating. */)) &&
INRANGE_OF(mo->mom[MX], 0, WALKSTOP_THRESHOLD) &&
INRANGE_OF(mo->mom[MY], 0, WALKSTOP_THRESHOLD))
{
// If in a walking frame, stop moving.
if(player && isInWalkState(player) && player->plr->mo == mo)
Expand Down
10 changes: 5 additions & 5 deletions doomsday/plugins/jheretic/src/p_mobj.c
Expand Up @@ -48,7 +48,7 @@
#define MAX_BOB_OFFSET (8)

#define NOMOMENTUM_THRESHOLD (0.000001f)
#define STOPSPEED (1.0f/1.6/10)
#define WALKSTOP_THRESHOLD (0.062484741f) // FIX2FLT(0x1000-1)
#define STANDSPEED (1.0f/2)

// TYPES -------------------------------------------------------------------
Expand Down Expand Up @@ -531,10 +531,10 @@ void P_MobjMoveXY(mobj_t* mo)
}

// Stop player walking animation.
if(!player || (!(player->plr->cmd.forwardMove | player->plr->cmd.sideMove) &&
player->plr->mo != mo /* $voodoodolls: Stop animating. */) &&
INRANGE_OF(mo->mom[MX], 0, STOPSPEED) &&
INRANGE_OF(mo->mom[MY], 0, STOPSPEED))
if((!player || (!(player->plr->cmd.forwardMove | player->plr->cmd.sideMove) &&
player->plr->mo != mo /* $voodoodolls: Stop animating. */)) &&
INRANGE_OF(mo->mom[MX], 0, WALKSTOP_THRESHOLD) &&
INRANGE_OF(mo->mom[MY], 0, WALKSTOP_THRESHOLD))
{
// If in a walking frame, stop moving.
if(player && isInWalkState(player) && player->plr->mo == mo)
Expand Down
10 changes: 5 additions & 5 deletions doomsday/plugins/jhexen/src/p_mobj.c
Expand Up @@ -54,7 +54,7 @@
#define HEAL_RADIUS_DIST 255

#define NOMOMENTUM_THRESHOLD (0.000001f)
#define STOPSPEED (0.1f/1.6)
#define WALKSTOP_THRESHOLD (0.062484741f) // FIX2FLT(0x1000-1)

#define SMALLSPLASHCLIP (12);

Expand Down Expand Up @@ -677,10 +677,10 @@ void P_MobjMoveXY(mobj_t* mo)
}
}

if(mo->mom[MX] > -STOPSPEED && mo->mom[MX] < STOPSPEED &&
mo->mom[MY] > -STOPSPEED && mo->mom[MY] < STOPSPEED &&
(!player || (player->plr->cmd.forwardMove == 0 &&
player->plr->cmd.sideMove == 0)))
// Stop player walking animation.
if((!player || (!(player->plr->cmd.forwardMove | player->plr->cmd.sideMove))) &&
INRANGE_OF(mo->mom[MX], 0, WALKSTOP_THRESHOLD) &&
INRANGE_OF(mo->mom[MY], 0, WALKSTOP_THRESHOLD))
{ // If in a walking frame, stop moving
if(player)
{
Expand Down

0 comments on commit 2dfb87c

Please sign in to comment.