Reduced length of new year event to 2 days.

This commit is contained in:
Learath2 2012-12-23 19:53:57 +02:00
parent 1c8c20c93e
commit c55cae6492
2 changed files with 17 additions and 24 deletions

View file

@ -693,16 +693,10 @@ void CGameContext::OnClientEnter(int ClientID)
dd = atoi(d);
mm = atoi(m);
yy = atoi(y);
if((mm == 12 && dd >= 20))
if((mm == 12 || mm == 1) && (dd == 31 || dd == 1))
{
char aBuf[128];
str_format(aBuf, sizeof(aBuf), "Happy %d from GreYFoX", yy+1);
SendBroadcast(aBuf, ClientID);
}
else if(mm == 1 && dd <= 20)
{
char aBuf[128];
str_format(aBuf, sizeof(aBuf), "Happy %d from GreYFoX", yy);
str_format(aBuf, sizeof(aBuf), "Happy %d from GreYFoX", mm==12?yy+1:yy);
SendBroadcast(aBuf, ClientID);
}
}

View file

@ -40,8 +40,11 @@ CPlayer::CPlayer(CGameContext *pGameServer, int ClientID, int Team)
m_ChatScore = 0;
m_EyeEmote = true;
m_TimerType = g_Config.m_SvDefaultTimerType;
m_DefEmote = EMOTE_NORMAL;
//New Year
if (g_Config.m_SvEvents)
{
time_t rawtime;
struct tm* timeinfo;
char d[16], m[16], y[16];
@ -54,11 +57,7 @@ CPlayer::CPlayer(CGameContext *pGameServer, int ClientID, int Team)
dd = atoi(d);
mm = atoi(m);
yy = atoi(y);
m_DefEmote = EMOTE_NORMAL;
if (g_Config.m_SvEvents)
{
m_DefEmote = ((mm == 12 && dd >= 20) || (mm == 1 && dd <= 20)) ? EMOTE_HAPPY : EMOTE_NORMAL;
m_DefEmote = ((mm == 12 && dd == 31) || (mm == 1 && dd == 1)) ? EMOTE_HAPPY : EMOTE_NORMAL;
}
m_DefEmoteReset = -1;