Skip to content

Commit

Permalink
Fixed incorrect conversion of bitshift to floating-point division.
Browse files Browse the repository at this point in the history
The original code had >>= 2, which is division by 4 and not 2.
  • Loading branch information
skyjake committed Nov 4, 2009
1 parent 0f4f4ad commit dbc65c1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions doomsday/plugins/common/src/p_view.c
Expand Up @@ -82,9 +82,8 @@ void P_CalcHeight(player_t* plr)

// Regular movement bobbing (needs to be calculated for gun swing even
// if not on ground).
plr->bob =
(pmo->mom[MX] * pmo->mom[MX]) + (pmo->mom[MY] * pmo->mom[MY]);
plr->bob /= 2;
plr->bob = (pmo->mom[MX] * pmo->mom[MX]) + (pmo->mom[MY] * pmo->mom[MY]);
plr->bob /= 4;
if(plr->bob > MAXBOB)
plr->bob = MAXBOB;

Expand Down Expand Up @@ -177,8 +176,7 @@ void P_CalcHeight(player_t* plr)
}

// Set the plr's eye-level Z coordinate.
ddplr->viewZ = pmo->pos[VZ] +
(P_MobjIsCamera(pmo)? 0 : ddplr->viewHeight);
ddplr->viewZ = pmo->pos[VZ] + (P_MobjIsCamera(pmo)? 0 : ddplr->viewHeight);

// During demo playback (or camera mode) the viewz will not be modified
// any further.
Expand Down

0 comments on commit dbc65c1

Please sign in to comment.