mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-16 09:12:05 +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 friction = ORIG_FRICTION;
|
||||||
int movefactor = ORIG_FRICTION_FACTOR;
|
int movefactor = ORIG_FRICTION_FACTOR;
|
||||||
|
fixed_t newfriction;
|
||||||
const msecnode_t *m;
|
const msecnode_t *m;
|
||||||
const sector_t *sec;
|
const sector_t *sec;
|
||||||
|
|
||||||
|
@ -498,8 +499,8 @@ int P_GetFriction (const AActor *mo, int *frictionfactor)
|
||||||
else if ((!(mo->flags & MF_NOGRAVITY) && mo->waterlevel > 1) ||
|
else if ((!(mo->flags & MF_NOGRAVITY) && mo->waterlevel > 1) ||
|
||||||
(mo->waterlevel == 1 && mo->z > mo->floorz + 6*FRACUNIT))
|
(mo->waterlevel == 1 && mo->z > mo->floorz + 6*FRACUNIT))
|
||||||
{
|
{
|
||||||
friction = secfriction (mo->Sector);
|
friction = secfriction(mo->Sector);
|
||||||
movefactor = secmovefac (mo->Sector) >> 1;
|
movefactor = secmovefac(mo->Sector) >> 1;
|
||||||
}
|
}
|
||||||
else if (var_friction && !(mo->flags & (MF_NOCLIP|MF_NOGRAVITY)))
|
else if (var_friction && !(mo->flags & (MF_NOCLIP|MF_NOGRAVITY)))
|
||||||
{ // When the object is straddling sectors with the same
|
{ // When the object is straddling sectors with the same
|
||||||
|
@ -512,16 +513,16 @@ int P_GetFriction (const AActor *mo, int *frictionfactor)
|
||||||
|
|
||||||
#ifdef _3DFLOORS
|
#ifdef _3DFLOORS
|
||||||
// 3D floors must be checked, too
|
// 3D floors must be checked, too
|
||||||
for(unsigned i=0;i<sec->e->XFloor.ffloors.Size();i++)
|
for (unsigned i = 0; i < sec->e->XFloor.ffloors.Size(); i++)
|
||||||
{
|
{
|
||||||
F3DFloor * rover=sec->e->XFloor.ffloors[i];
|
F3DFloor *rover = sec->e->XFloor.ffloors[i];
|
||||||
if (!(rover->flags&FF_EXISTS)) continue;
|
if (!(rover->flags & FF_EXISTS)) continue;
|
||||||
if(!(rover->flags & FF_SOLID)) continue;
|
if (!(rover->flags & FF_SOLID)) continue;
|
||||||
|
|
||||||
// Player must be on top of the floor to be affected...
|
// Player must be on top of the floor to be affected...
|
||||||
if(mo->z != rover->top.plane->ZatPoint(mo->x,mo->y)) continue;
|
if (mo->z != rover->top.plane->ZatPoint(mo->x,mo->y)) continue;
|
||||||
fixed_t newfriction=secfriction(rover->model);
|
newfriction = secfriction(rover->model);
|
||||||
if (newfriction<friction)
|
if (newfriction < friction || friction == ORIG_FRICTION)
|
||||||
{
|
{
|
||||||
friction = newfriction;
|
friction = newfriction;
|
||||||
movefactor = secmovefac(rover->model);
|
movefactor = secmovefac(rover->model);
|
||||||
|
@ -534,13 +535,14 @@ int P_GetFriction (const AActor *mo, int *frictionfactor)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ((secfriction(sec) < friction || friction == ORIG_FRICTION) &&
|
newfriction = secfriction(sec);
|
||||||
(mo->z <= sec->floorplane.ZatPoint (mo->x, mo->y) ||
|
if ((newfriction < friction || friction == ORIG_FRICTION) &&
|
||||||
|
(mo->z <= sec->floorplane.ZatPoint(mo->x, mo->y) ||
|
||||||
(sec->GetHeightSec() != NULL &&
|
(sec->GetHeightSec() != NULL &&
|
||||||
mo->z <= sec->heightsec->floorplane.ZatPoint (mo->x, mo->y))))
|
mo->z <= sec->heightsec->floorplane.ZatPoint(mo->x, mo->y))))
|
||||||
{
|
{
|
||||||
friction = secfriction (sec);
|
friction = newfriction;
|
||||||
movefactor = secmovefac (sec);
|
movefactor = secmovefac(sec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue