- Move doslopetilting() into DDukePlayer.

This commit is contained in:
Mitchell Richters 2023-10-03 13:37:34 +11:00 committed by Christoph Oelckers
parent c029273e19
commit 54d307a7e6
4 changed files with 11 additions and 11 deletions

View file

@ -175,11 +175,6 @@ inline bool playrunning()
return (paused == 0 || (paused == 1 && (ud.recstat == 2 || ud.multimode > 1))); return (paused == 0 || (paused == 1 && (ud.recstat == 2 || ud.multimode > 1)));
} }
inline void doslopetilting(DDukePlayer* p)
{
p->Angles.doViewPitch(p->aim_mode == 0 && p->on_ground && p->cursector->lotag != ST_2_UNDERWATER);
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// //

View file

@ -1580,7 +1580,7 @@ void processinput_d(int snum)
pact->floorz = floorz; pact->floorz = floorz;
pact->ceilingz = ceilingz; pact->ceilingz = ceilingz;
doslopetilting(p); p->doslopetilting();
if (chz.type == kHitSprite) if (chz.type == kHitSprite)
{ {

View file

@ -2347,7 +2347,7 @@ void processinput_r(int snum)
pact->floorz = floorz; pact->floorz = floorz;
pact->ceilingz = ceilingz; pact->ceilingz = ceilingz;
doslopetilting(p); p->doslopetilting();
if (chz.type == kHitSprite) if (chz.type == kHitSprite)
{ {

View file

@ -361,22 +361,22 @@ public:
void checkhardlanding(); void checkhardlanding();
void playerweaponsway(double xvel); void playerweaponsway(double xvel);
float adjustavel(float avel) inline float adjustavel(float avel)
{ {
return (psectlotag == ST_2_UNDERWATER)? avel * 0.875f : avel; return (psectlotag == ST_2_UNDERWATER)? avel * 0.875f : avel;
} }
void setCursector(sectortype* sect) inline void setCursector(sectortype* sect)
{ {
cursector = sect; cursector = sect;
} }
bool insector() const inline bool insector() const
{ {
return cursector != nullptr; return cursector != nullptr;
} }
void setbobpos() inline void setbobpos()
{ {
bobpos = GetActor()->spr.pos.XY(); bobpos = GetActor()->spr.pos.XY();
} }
@ -399,6 +399,11 @@ public:
cmd.ucmd.actions &= ~SB_CENTERVIEW; cmd.ucmd.actions &= ~SB_CENTERVIEW;
} }
} }
inline void doslopetilting()
{
Angles.doViewPitch(aim_mode == 0 && on_ground && cursector->lotag != ST_2_UNDERWATER);
}
}; };
struct Cycler struct Cycler