mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-29 07:22:07 +00:00
- 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:
parent
0a8ffaecd9
commit
4d6447a55b
1 changed files with 16 additions and 14 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue