diff --git a/source/games/duke/src/hudweapon_d.cpp b/source/games/duke/src/hudweapon_d.cpp index 212d257ff..09848c3c1 100644 --- a/source/games/duke/src/hudweapon_d.cpp +++ b/source/games/duke/src/hudweapon_d.cpp @@ -39,9 +39,9 @@ source as it is released. BEGIN_DUKE_NS -inline static double getavel(int snum) +inline static double getavel(DDukePlayer* const p) { - return PlayerInputAngVel(snum) * (2048. / 360.); + return p->cmd.ucmd.avel * (2048. / 360.); } //--------------------------------------------------------------------------- @@ -72,7 +72,7 @@ static void displayloogie(DDukePlayer* p, double const interpfrac) { const double a = fabs(BobVal((loogi + i) * 32.) * 90); const double z = 4096. + ((loogi + i) * 512.); - const double x = -getavel(p->GetPlayerNum()) + BobVal((loogi + i) * 64.) * 16; + const double x = -getavel(p) + BobVal((loogi + i) * 64.) * 16; hud_drawsprite((p->loogie[i].X + x), (200 + p->loogie[i].Y - y), (z - (i << 8)) / 65536., a - 22.5, TexMan.CheckForTexture("LOOGIE", ETextureType::Any), 0, 0, 0); } @@ -252,7 +252,7 @@ void displayweapon_d(int snum, double interpfrac) auto offpair = p->Angles.getWeaponOffsets(interpfrac); auto offsets = offpair.first; auto pitchoffset = 16. * (p->Angles.getRenderAngles(interpfrac).Pitch / DAngle90); - auto yawinput = getavel(snum) * (1. / 16.); + auto yawinput = getavel(p) * (1. / 16.); auto angle = offpair.second; auto weapon_xoffset = 160 - 90 - (BobVal(512 + weapon_sway * 0.5) * (16384. / 1536.)) - 58 - p->weapon_ang; auto shade = min(p->GetActor()->spr.shade, (int8_t)24); diff --git a/source/games/duke/src/inlines.h b/source/games/duke/src/inlines.h index a9cf1e863..06e09238d 100644 --- a/source/games/duke/src/inlines.h +++ b/source/games/duke/src/inlines.h @@ -147,21 +147,11 @@ inline float PlayerInputForwardVel(int pl) return getPlayer(pl)->cmd.ucmd.fvel; } -inline float PlayerInputAngVel(int pl) -{ - return getPlayer(pl)->cmd.ucmd.avel; -} - -inline DAngle GetPlayerHorizon(int pl) -{ - return DAngle::fromDeg(getPlayer(pl)->cmd.ucmd.horz); -} - inline void clearfriction() { for (int i = 0; i != -1; i = connectpoint2[i]) { - getPlayer(i)->fric.X = getPlayer(i)->fric.Y = 0; + getPlayer(i)->fric.Zero(); } }