mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge pull request #7476 from ChillerDragon/pr_const_char
Overload GetCharacter with const version
This commit is contained in:
commit
9b024fcf97
|
@ -578,6 +578,13 @@ CCharacter *CPlayer::GetCharacter()
|
|||
return 0;
|
||||
}
|
||||
|
||||
const CCharacter *CPlayer::GetCharacter() const
|
||||
{
|
||||
if(m_pCharacter && m_pCharacter->IsAlive())
|
||||
return m_pCharacter;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CPlayer::KillCharacter(int Weapon, bool SendKillMsg)
|
||||
{
|
||||
if(m_pCharacter)
|
||||
|
|
|
@ -64,6 +64,7 @@ public:
|
|||
|
||||
void KillCharacter(int Weapon = WEAPON_GAME, bool SendKillMsg = true);
|
||||
CCharacter *GetCharacter();
|
||||
const CCharacter *GetCharacter() const;
|
||||
|
||||
void SpectatePlayerName(const char *pName);
|
||||
|
||||
|
|
Loading…
Reference in a new issue