mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
made it possible to add just a clan as friend
This commit is contained in:
parent
b3ae1a088e
commit
85e9fb1e63
|
@ -48,7 +48,7 @@ bool CFriends::IsFriend(const char *pName, const char *pClan) const
|
|||
{
|
||||
for(int i = 0; i < m_NumFriends; ++i)
|
||||
{
|
||||
if(!str_comp(m_aFriends[i].m_aName, pName) && !str_comp(m_aFriends[i].m_aClan, pClan))
|
||||
if((m_aFriends[i].m_aName[0] == 0 || !str_comp(m_aFriends[i].m_aName, pName)) && !str_comp(m_aFriends[i].m_aClan, pClan))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -56,7 +56,7 @@ bool CFriends::IsFriend(const char *pName, const char *pClan) const
|
|||
|
||||
void CFriends::AddFriend(const char *pName, const char *pClan)
|
||||
{
|
||||
if(m_NumFriends == MAX_FRIENDS)
|
||||
if(m_NumFriends == MAX_FRIENDS || (pName[0] == 0 && pClan[0] == 0))
|
||||
return;
|
||||
|
||||
// make sure we don't have the friend already
|
||||
|
|
Loading…
Reference in a new issue