- changed a few vel setter calls.

This commit is contained in:
Christoph Oelckers 2022-09-25 19:32:14 +02:00
parent e00eda6cb8
commit 5c6cac49c8
4 changed files with 8 additions and 10 deletions

View file

@ -304,8 +304,7 @@ void aiMoveForward(DBloodActor* actor)
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
if (abs(nAng) > DAngle60) if (abs(nAng) > DAngle60)
return; return;
actor->add_int_bvel_x(MulScale(pDudeInfo->frontSpeed, Cos(actor->int_ang()), 30)); actor->vel.XY() += actor->spr.angle.ToVector() * pDudeInfo->FrontSpeed();
actor->add_int_bvel_y(MulScale(pDudeInfo->frontSpeed, Sin(actor->int_ang()), 30));
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View file

@ -402,8 +402,7 @@ static void beastMoveForward(DBloodActor* actor)
int nDist = approxDist(dvec); int nDist = approxDist(dvec);
if (nDist <= 0x400 && Random(64) < 32) if (nDist <= 0x400 && Random(64) < 32)
return; return;
actor->add_int_bvel_x(MulScale(pDudeInfo->frontSpeed, Cos(actor->int_ang()), 30)); actor->vel.XY() += actor->spr.angle.ToVector() * pDudeInfo->FrontSpeed();
actor->add_int_bvel_y(MulScale(pDudeInfo->frontSpeed, Sin(actor->int_ang()), 30));
} }
static void sub_628A0(DBloodActor* actor) static void sub_628A0(DBloodActor* actor)

View file

@ -64,15 +64,15 @@ struct DUDEINFO {
return seeDist * maptoworld; return seeDist * maptoworld;
} }
inline double EyeHeight() const
{
return eyeHeight * maptoworld;
}
inline DAngle Periphery() const inline DAngle Periphery() const
{ {
return mapangle(periphery); return mapangle(periphery);
} }
inline double FrontSpeed() const
{
return FixedToFloat(frontSpeed);
}
}; };
extern DUDEINFO dudeInfo[kDudeMax - kDudeBase]; extern DUDEINFO dudeInfo[kDudeMax - kDudeBase];

View file

@ -265,7 +265,7 @@ void CFX::fxProcess(void)
continue; continue;
} }
} }
actor->add_int_bvel_z(pFXData->gravity); actor->vel.Z += FixedToFloat(pFXData->gravity);
} }
} }