CPlayer: Correctly restore the default emote on override emote expired

We used to set EMOTE_NORMAL even on 'special' days ('events' config option).
This commit is contained in:
Alexander Akulich 2021-01-12 22:21:35 +03:00
parent f0e34c9c36
commit 281186468f
2 changed files with 10 additions and 7 deletions

View file

@ -102,7 +102,7 @@ void CPlayer::Reset()
m_DefEmote = EMOTE_NORMAL;
}
}
m_DefEmoteReset = -1;
m_OverrideEmoteReset = -1;
GameServer()->Score()->PlayerData(m_ClientID)->Reset();
@ -270,10 +270,9 @@ void CPlayer::Tick()
GameServer()->SendTuningParams(m_ClientID, m_TuneZone);
}
if(m_DefEmoteReset >= 0 && m_DefEmoteReset <= Server()->Tick())
if(m_OverrideEmoteReset >= 0 && m_OverrideEmoteReset <= Server()->Tick())
{
m_DefEmoteReset = -1;
m_DefEmote = EMOTE_NORMAL;
m_OverrideEmoteReset = -1;
}
if(m_Halloween && m_pCharacter && !m_pCharacter->IsPaused())
@ -789,13 +788,16 @@ void CPlayer::AfkVoteTimer(CNetObj_PlayerInput *NewTarget)
int CPlayer::GetDefaultEmote() const
{
if(m_OverrideEmoteReset >= 0)
return m_OverrideEmote;
return m_DefEmote;
}
void CPlayer::OverrideDefaultEmote(int Emote, int Tick)
{
m_DefEmote = Emote;
m_DefEmoteReset = Tick;
m_OverrideEmote = Emote;
m_OverrideEmoteReset = Tick;
m_LastEyeEmote = Server()->Tick();
}

View file

@ -198,7 +198,8 @@ public:
bool CanOverrideDefaultEmote() const;
int m_DefEmote;
int m_DefEmoteReset;
int m_OverrideEmote;
int m_OverrideEmoteReset;
bool m_Halloween;
bool m_FirstPacket;
int64 m_LastSQLQuery;