- Clean up some GCC const warnings.

This commit is contained in:
Mitchell Richters 2023-11-05 20:54:17 +11:00
parent 85bbf80dba
commit 9e1ce2b970
5 changed files with 14 additions and 14 deletions

View file

@ -39,10 +39,10 @@ public:
// All overridable methods. // All overridable methods.
virtual DCoreActor* GetActor() = 0; virtual DCoreActor* GetActor() = 0;
virtual const bool canSlopeTilt() const { return false; } virtual bool canSlopeTilt() const { return false; }
virtual const unsigned getCrouchFlags() const = 0; virtual unsigned getCrouchFlags() const = 0;
virtual double GetMaxInputVel() const = 0;
virtual const DVector2& GetInputVelocity() const { return actor->vel.XY(); } virtual const DVector2& GetInputVelocity() const { return actor->vel.XY(); }
virtual const double GetMaxInputVel() const = 0;
// Angle prototypes. // Angle prototypes.
void doPitchInput(); void doPitchInput();

View file

@ -300,19 +300,19 @@ public:
return static_cast<DBloodActor*>(actor); return static_cast<DBloodActor*>(actor);
} }
const double GetMaxInputVel() const override double GetMaxInputVel() const override
{ {
return (36211. / 3000.); return (36211. / 3000.);
} }
const bool canSlopeTilt() const override bool canSlopeTilt() const override
{ {
const auto pActor = static_cast<DBloodActor*>(actor); const auto pActor = static_cast<DBloodActor*>(actor);
const int florhit = pActor->hit.florhit.type; const int florhit = pActor->hit.florhit.type;
return pActor->xspr.height < 16 && (florhit == kHitSector || florhit == 0); return pActor->xspr.height < 16 && (florhit == kHitSector || florhit == 0);
} }
const unsigned getCrouchFlags() const override unsigned getCrouchFlags() const override
{ {
const bool swimming = posture == kPostureSwim; const bool swimming = posture == kPostureSwim;
return (CS_CANCROUCH * !swimming) | (CS_DISABLETOGGLE * swimming); return (CS_CANCROUCH * !swimming) | (CS_DISABLETOGGLE * swimming);

View file

@ -361,7 +361,7 @@ public:
void checkhardlanding(); void checkhardlanding();
void playerweaponsway(double xvel); void playerweaponsway(double xvel);
const double GetMaxInputVel() const override double GetMaxInputVel() const override
{ {
return (117351124. / 10884538.); return (117351124. / 10884538.);
} }
@ -405,7 +405,7 @@ public:
} }
} }
const bool canSlopeTilt() const override bool canSlopeTilt() const override
{ {
return aim_mode == 0 && on_ground && cursector->lotag != ST_2_UNDERWATER; return aim_mode == 0 && on_ground && cursector->lotag != ST_2_UNDERWATER;
} }
@ -420,7 +420,7 @@ public:
cmd.ucmd.setItemUsed(num - 1); cmd.ucmd.setItemUsed(num - 1);
} }
const unsigned getCrouchFlags() const override unsigned getCrouchFlags() const override
{ {
const int sectorLotag = insector() ? cursector->lotag : 0; const int sectorLotag = insector() ? cursector->lotag : 0;
const int crouchable = sectorLotag != ST_2_UNDERWATER && (sectorLotag != ST_1_ABOVE_WATER || spritebridge) && !jetpack_on; const int crouchable = sectorLotag != ST_2_UNDERWATER && (sectorLotag != ST_1_ABOVE_WATER || spritebridge) && !jetpack_on;

View file

@ -119,12 +119,12 @@ public:
return static_cast<DExhumedActor*>(actor); return static_cast<DExhumedActor*>(actor);
} }
const double GetMaxInputVel() const override double GetMaxInputVel() const override
{ {
return 15.25; return 15.25;
} }
const unsigned getCrouchFlags() const override unsigned getCrouchFlags() const override
{ {
return (CS_CANCROUCH * !bUnderwater) | (CS_DISABLETOGGLE * bUnderwater); return (CS_CANCROUCH * !bUnderwater) | (CS_DISABLETOGGLE * bUnderwater);
} }

View file

@ -1851,7 +1851,7 @@ public:
uint8_t WpnReloadState; uint8_t WpnReloadState;
const double GetMaxInputVel() const override double GetMaxInputVel() const override
{ {
return (380401538. / 36022361.); return (380401538. / 36022361.);
} }
@ -1861,7 +1861,7 @@ public:
return vect; return vect;
} }
const bool canSlopeTilt() const override bool canSlopeTilt() const override
{ {
return (cmd.ucmd.actions & SB_AIMMODE) && !(Flags & (PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING)); return (cmd.ucmd.actions & SB_AIMMODE) && !(Flags & (PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING));
} }
@ -1876,7 +1876,7 @@ public:
GetActor()->spr.pos.Z = val - GetActor()->viewzoffset; GetActor()->spr.pos.Z = val - GetActor()->viewzoffset;
} }
const unsigned getCrouchFlags() const override unsigned getCrouchFlags() const override
{ {
const bool crouchable = true; const bool crouchable = true;
const bool disableToggle = (Flags & (PF_JUMPING|PF_FALLING|PF_CLIMBING|PF_DIVING|PF_DEAD)) || sop; const bool disableToggle = (Flags & (PF_JUMPING|PF_FALLING|PF_CLIMBING|PF_DIVING|PF_DEAD)) || sop;