Mark some character methods const

This commit is contained in:
ChillerDragon 2024-05-29 08:13:16 +08:00
parent 5ad62b5732
commit ffd0da09e9

View file

@ -84,7 +84,7 @@ public:
void Rescue(); void Rescue();
int NeededFaketuning() { return m_NeededFaketuning; } int NeededFaketuning() const { return m_NeededFaketuning; }
bool IsAlive() const { return m_Alive; } bool IsAlive() const { return m_Alive; }
bool IsPaused() const { return m_Paused; } bool IsPaused() const { return m_Paused; }
class CPlayer *GetPlayer() { return m_pPlayer; } class CPlayer *GetPlayer() { return m_pPlayer; }
@ -229,12 +229,12 @@ public:
int m_WeaponChangeTick; int m_WeaponChangeTick;
// Setters/Getters because i don't want to modify vanilla vars access modifiers // Setters/Getters because i don't want to modify vanilla vars access modifiers
int GetLastWeapon() { return m_LastWeapon; } int GetLastWeapon() const { return m_LastWeapon; }
void SetLastWeapon(int LastWeap) { m_LastWeapon = LastWeap; } void SetLastWeapon(int LastWeap) { m_LastWeapon = LastWeap; }
int GetActiveWeapon() { return m_Core.m_ActiveWeapon; } int GetActiveWeapon() const { return m_Core.m_ActiveWeapon; }
void SetActiveWeapon(int ActiveWeap) { m_Core.m_ActiveWeapon = ActiveWeap; } void SetActiveWeapon(int ActiveWeap) { m_Core.m_ActiveWeapon = ActiveWeap; }
void SetLastAction(int LastAction) { m_LastAction = LastAction; } void SetLastAction(int LastAction) { m_LastAction = LastAction; }
int GetArmor() { return m_Armor; } int GetArmor() const { return m_Armor; }
void SetArmor(int Armor) { m_Armor = Armor; } void SetArmor(int Armor) { m_Armor = Armor; }
CCharacterCore GetCore() { return m_Core; } CCharacterCore GetCore() { return m_Core; }
void SetCore(CCharacterCore Core) { m_Core = Core; } void SetCore(CCharacterCore Core) { m_Core = Core; }
@ -249,16 +249,16 @@ public:
int GetLastAction() const { return m_LastAction; } int GetLastAction() const { return m_LastAction; }
bool HasTelegunGun() { return m_Core.m_HasTelegunGun; } bool HasTelegunGun() const { return m_Core.m_HasTelegunGun; }
bool HasTelegunGrenade() { return m_Core.m_HasTelegunGrenade; } bool HasTelegunGrenade() const { return m_Core.m_HasTelegunGrenade; }
bool HasTelegunLaser() { return m_Core.m_HasTelegunLaser; } bool HasTelegunLaser() const { return m_Core.m_HasTelegunLaser; }
bool HammerHitDisabled() { return m_Core.m_HammerHitDisabled; } bool HammerHitDisabled() const { return m_Core.m_HammerHitDisabled; }
bool ShotgunHitDisabled() { return m_Core.m_ShotgunHitDisabled; } bool ShotgunHitDisabled() const { return m_Core.m_ShotgunHitDisabled; }
bool LaserHitDisabled() { return m_Core.m_LaserHitDisabled; } bool LaserHitDisabled() const { return m_Core.m_LaserHitDisabled; }
bool GrenadeHitDisabled() { return m_Core.m_GrenadeHitDisabled; } bool GrenadeHitDisabled() const { return m_Core.m_GrenadeHitDisabled; }
bool IsSuper() { return m_Core.m_Super; } bool IsSuper() const { return m_Core.m_Super; }
CSaveTee &GetLastRescueTeeRef(int Mode = RESCUEMODE_AUTO) { return m_RescueTee[Mode]; } CSaveTee &GetLastRescueTeeRef(int Mode = RESCUEMODE_AUTO) { return m_RescueTee[Mode]; }
}; };