- Don't call secfriction() twice in the normal part of P_GetFriction().

- Fixed: The 3D floors part of P_GetFriction() did not check for friction still being set to
  ORIG_FRICTION, so it only worked with lower frictions.

SVN r3538 (trunk)
This commit is contained in:
Randy Heit 2012-04-08 04:43:19 +00:00
parent 0a8ffaecd9
commit 4d6447a55b

View file

@ -488,6 +488,7 @@ int P_GetFriction (const AActor *mo, int *frictionfactor)
{
int friction = ORIG_FRICTION;
int movefactor = ORIG_FRICTION_FACTOR;
fixed_t newfriction;
const msecnode_t *m;
const sector_t *sec;
@ -520,8 +521,8 @@ int P_GetFriction (const AActor *mo, int *frictionfactor)
// Player must be on top of the floor to be affected...
if (mo->z != rover->top.plane->ZatPoint(mo->x,mo->y)) continue;
fixed_t newfriction=secfriction(rover->model);
if (newfriction<friction)
newfriction = secfriction(rover->model);
if (newfriction < friction || friction == ORIG_FRICTION)
{
friction = newfriction;
movefactor = secmovefac(rover->model);
@ -534,12 +535,13 @@ int P_GetFriction (const AActor *mo, int *frictionfactor)
{
continue;
}
if ((secfriction(sec) < friction || friction == ORIG_FRICTION) &&
newfriction = secfriction(sec);
if ((newfriction < friction || friction == ORIG_FRICTION) &&
(mo->z <= sec->floorplane.ZatPoint(mo->x, mo->y) ||
(sec->GetHeightSec() != NULL &&
mo->z <= sec->heightsec->floorplane.ZatPoint(mo->x, mo->y))))
{
friction = secfriction (sec);
friction = newfriction;
movefactor = secmovefac(sec);
}
}