- Duke: Got rid of two more InputPacket wrappers.

This commit is contained in:
Mitchell Richters 2023-10-03 19:03:54 +11:00
parent 984ae6b098
commit af99ba9ae2
4 changed files with 7 additions and 23 deletions

View file

@ -137,16 +137,6 @@ inline bool PlayerUseItem(int pl, int num)
return getPlayer(pl)->cmd.ucmd.isItemUsed(num - 1);
}
inline double PlayerInputSideVel(int pl)
{
return getPlayer(pl)->cmd.ucmd.vel.Y;
}
inline double PlayerInputForwardVel(int pl)
{
return getPlayer(pl)->cmd.ucmd.vel.X;
}
inline void clearfriction()
{
for (int i = 0; i != -1; i = connectpoint2[i])

View file

@ -1544,12 +1544,10 @@ void processinput_d(int snum)
ESyncBits& actions = p->cmd.ucmd.actions;
// Get strafe value before it's rotated by the angle.
const auto strafeVel = PlayerInputSideVel(snum);
const auto strafeVel = p->cmd.ucmd.vel.Y;
constexpr auto maxVel = (117351124. / 10884538.);
processinputvel(snum);
auto sb_fvel = PlayerInputForwardVel(snum);
auto sb_svel = PlayerInputSideVel(snum);
auto psectp = p->cursector;
if (psectp == nullptr)
@ -1743,7 +1741,7 @@ void processinput_d(int snum)
}
}
if (p->vel.X || p->vel.Y || sb_fvel || sb_svel)
if (p->vel.X || p->vel.Y || !p->cmd.ucmd.vel.XY().isZero())
{
p->crack_time = CRACK_TIME;
@ -1783,8 +1781,7 @@ void processinput_d(int snum)
if (p->jetpack_on == 0 && p->steroids_amount > 0 && p->steroids_amount < 400)
doubvel <<= 1;
p->vel.X += sb_fvel * doubvel * (5. / 16.);
p->vel.Y += sb_svel * doubvel * (5. / 16.);
p->vel.XY() += p->cmd.ucmd.vel.XY() * doubvel * (5. / 16.);
p->Angles.StrafeVel += strafeVel * doubvel * (5. / 16.);
bool check;

View file

@ -2274,7 +2274,7 @@ void processinput_r(int snum)
ESyncBits& actions = p->cmd.ucmd.actions;
// Get strafe value before it's rotated by the angle.
const auto strafeVel = PlayerInputSideVel(snum);
const auto strafeVel = p->cmd.ucmd.vel.Y;
constexpr auto maxVel = (117351124. / 10884538.);
auto psectp = p->cursector;
@ -2288,8 +2288,6 @@ void processinput_r(int snum)
}
processinputvel(snum);
auto sb_fvel = PlayerInputForwardVel(snum);
auto sb_svel = PlayerInputSideVel(snum);
if (psectp == nullptr)
{
@ -2570,7 +2568,7 @@ void processinput_r(int snum)
}
}
if (p->vel.X || p->vel.Y || sb_fvel || sb_svel)
if (p->vel.X || p->vel.Y || !p->cmd.ucmd.vel.XY().isZero())
{
p->crack_time = CRACK_TIME;
@ -2625,8 +2623,7 @@ void processinput_r(int snum)
if (p->jetpack_on == 0 && p->steroids_amount > 0 && p->steroids_amount < 400)
doubvel <<= 1;
p->vel.X += sb_fvel * doubvel * (5. / 16.);
p->vel.Y += sb_svel * doubvel * (5. / 16.);
p->vel.XY() += p->cmd.ucmd.vel.XY() * doubvel * (5. / 16.);
p->Angles.StrafeVel += strafeVel * doubvel * (5. / 16.);
if (!isRRRA() && ((p->curr_weapon == KNEE_WEAPON && p->kickback_pic > 10 && p->on_ground) || (p->on_ground && (actions & SB_CROUCH))))

View file

@ -228,7 +228,7 @@ void checksectors_d(int snum)
if (p->newOwner != nullptr)
{
if (abs(PlayerInputSideVel(snum)) > 0.75 || abs(PlayerInputForwardVel(snum)) > 0.75)
if (abs(p->cmd.ucmd.vel.Y) > 0.75 || abs(p->cmd.ucmd.vel.X) > 0.75)
{
clearcameras(p);
return;