Removed FVF_RESETPITCH.

This commit is contained in:
MajorCooke 2015-11-25 23:15:59 -06:00
parent ab5b1f479a
commit a1e3112850
2 changed files with 4 additions and 10 deletions

View File

@ -5943,7 +5943,6 @@ enum FVFlags
FVF_NOPITCH = 1 << 0, FVF_NOPITCH = 1 << 0,
FVF_INTERPOLATE = 1 << 1, FVF_INTERPOLATE = 1 << 1,
FVF_NOANGLE = 1 << 2, FVF_NOANGLE = 1 << 2,
FVF_RESETPITCH = 1 << 3,
}; };
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FaceVelocity) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FaceVelocity)
{ {
@ -5966,9 +5965,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FaceVelocity)
//Don't bother calculating this if we don't have any horizontal movement. //Don't bother calculating this if we don't have any horizontal movement.
if (!(flags & FVF_NOANGLE) && (mobj->velx != 0 || mobj->vely != 0)) if (!(flags & FVF_NOANGLE) && (mobj->velx != 0 || mobj->vely != 0))
{ {
const fixed_t vx = mobj->velx + mobj->x, vy = mobj->vely + mobj->y;
angle_t current = mobj->angle; angle_t current = mobj->angle;
const angle_t angle = R_PointToAngle2(mobj->x, mobj->y, vx, vy); const angle_t angle = R_PointToAngle2(0, 0, mobj->velx, mobj->vely);
//Done because using anglelimit directly causes a signed/unsigned mismatch. //Done because using anglelimit directly causes a signed/unsigned mismatch.
const angle_t limit = anglelimit; const angle_t limit = anglelimit;
@ -6029,19 +6027,16 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FaceVelocity)
max = MIN(plimit, (pitch - current)); max = MIN(plimit, (pitch - current));
current += max; current += max;
} }
if ((mobj->velz != 0) || (flags & FVF_RESETPITCH))
mobj->SetPitch(current, !!(flags & FVF_INTERPOLATE)); mobj->SetPitch(current, !!(flags & FVF_INTERPOLATE));
} }
else else
{ {
if ((mobj->velz != 0) || (flags & FVF_RESETPITCH))
mobj->SetPitch(pitch, !!(flags & FVF_INTERPOLATE)); mobj->SetPitch(pitch, !!(flags & FVF_INTERPOLATE));
} }
} }
else else
{ {
if ((mobj->velz != 0) || (flags & FVF_RESETPITCH))
mobj->SetPitch(pitch, !!(flags & FVF_INTERPOLATE)); mobj->SetPitch(pitch, !!(flags & FVF_INTERPOLATE));
} }
} }

View File

@ -501,7 +501,6 @@ enum
FVF_NOPITCH = 1 << 0, FVF_NOPITCH = 1 << 0,
FVF_INTERPOLATE = 1 << 1, FVF_INTERPOLATE = 1 << 1,
FVF_NOANGLE = 1 << 2, FVF_NOANGLE = 1 << 2,
FVF_RESETPITCH = 1 << 3,
}; };
// This is only here to provide one global variable for testing. // This is only here to provide one global variable for testing.