mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-12 19:18:20 +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;
|
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)
|
void CPlayer::KillCharacter(int Weapon, bool SendKillMsg)
|
||||||
{
|
{
|
||||||
if(m_pCharacter)
|
if(m_pCharacter)
|
||||||
|
|
|
@ -64,6 +64,7 @@ public:
|
||||||
|
|
||||||
void KillCharacter(int Weapon = WEAPON_GAME, bool SendKillMsg = true);
|
void KillCharacter(int Weapon = WEAPON_GAME, bool SendKillMsg = true);
|
||||||
CCharacter *GetCharacter();
|
CCharacter *GetCharacter();
|
||||||
|
const CCharacter *GetCharacter() const;
|
||||||
|
|
||||||
void SpectatePlayerName(const char *pName);
|
void SpectatePlayerName(const char *pName);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue