mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Only announce birthday once (fixes #5576)
No matter if you use /timecp or rename
This commit is contained in:
parent
e257a9ace1
commit
aa18c1ee78
|
@ -145,6 +145,7 @@ void CPlayer::Reset()
|
|||
m_EligibleForFinishCheck = 0;
|
||||
m_VotedForPractice = false;
|
||||
m_SwapTargetsClientID = -1;
|
||||
m_BirthdayAnnounced = false;
|
||||
}
|
||||
|
||||
static int PlayerFlags_SixToSeven(int Flags)
|
||||
|
@ -887,7 +888,7 @@ void CPlayer::ProcessScoreResult(CScorePlayerResult &Result)
|
|||
m_Score = -10000;
|
||||
Server()->ExpireServerInfo();
|
||||
int Birthday = Result.m_Data.m_Info.m_Birthday;
|
||||
if(Birthday != 0)
|
||||
if(Birthday != 0 && !m_BirthdayAnnounced)
|
||||
{
|
||||
char aBuf[512];
|
||||
str_format(aBuf, sizeof(aBuf),
|
||||
|
@ -898,6 +899,7 @@ void CPlayer::ProcessScoreResult(CScorePlayerResult &Result)
|
|||
"Happy DDNet birthday, %s!\nYou have finished your first map exactly %d year%s ago!",
|
||||
Server()->ClientName(m_ClientID), Birthday, Birthday > 1 ? "s" : "");
|
||||
GameServer()->SendBroadcast(aBuf, m_ClientID);
|
||||
m_BirthdayAnnounced = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -214,6 +214,7 @@ public:
|
|||
int64_t m_EligibleForFinishCheck;
|
||||
bool m_VotedForPractice;
|
||||
int m_SwapTargetsClientID; //Client ID of the swap target for the given player
|
||||
bool m_BirthdayAnnounced;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue