mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-13 03:28:19 +00:00
Merge branch 'ddrace-emotefix' of https://github.com/fisted/teeworlds
This commit is contained in:
commit
3c5a430135
|
@ -892,17 +892,17 @@ void CGameContext::ConEyeEmote(IConsole::IResult *pResult, void *pUserData, int
|
||||||
if (pChr)
|
if (pChr)
|
||||||
{
|
{
|
||||||
if (!str_comp(pResult->GetString(0), "angry"))
|
if (!str_comp(pResult->GetString(0), "angry"))
|
||||||
pChr->m_EmoteType = EMOTE_ANGRY;
|
pChr->m_DefEmote = EMOTE_ANGRY;
|
||||||
else if (!str_comp(pResult->GetString(0), "blink"))
|
else if (!str_comp(pResult->GetString(0), "blink"))
|
||||||
pChr->m_EmoteType = EMOTE_BLINK;
|
pChr->m_DefEmote = EMOTE_BLINK;
|
||||||
else if (!str_comp(pResult->GetString(0), "close"))
|
else if (!str_comp(pResult->GetString(0), "close"))
|
||||||
pChr->m_EmoteType = EMOTE_BLINK;
|
pChr->m_DefEmote = EMOTE_BLINK;
|
||||||
else if (!str_comp(pResult->GetString(0), "happy"))
|
else if (!str_comp(pResult->GetString(0), "happy"))
|
||||||
pChr->m_EmoteType = EMOTE_HAPPY;
|
pChr->m_DefEmote = EMOTE_HAPPY;
|
||||||
else if (!str_comp(pResult->GetString(0), "pain"))
|
else if (!str_comp(pResult->GetString(0), "pain"))
|
||||||
pChr->m_EmoteType = EMOTE_PAIN;
|
pChr->m_DefEmote = EMOTE_PAIN;
|
||||||
else if (!str_comp(pResult->GetString(0), "surprise"))
|
else if (!str_comp(pResult->GetString(0), "surprise"))
|
||||||
pChr->m_EmoteType = EMOTE_SURPRISE;
|
pChr->m_DefEmote = EMOTE_SURPRISE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", "Unkown emote... Say /emote");
|
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", "Unkown emote... Say /emote");
|
||||||
|
@ -912,7 +912,7 @@ void CGameContext::ConEyeEmote(IConsole::IResult *pResult, void *pUserData, int
|
||||||
if (pResult->NumArguments() > 1)
|
if (pResult->NumArguments() > 1)
|
||||||
Duration = pResult->GetInteger(1);
|
Duration = pResult->GetInteger(1);
|
||||||
|
|
||||||
pChr->m_EmoteStop = pSelf->Server()->Tick() + Duration * pSelf->Server()->TickSpeed();
|
pChr->m_DefEmoteReset = pSelf->Server()->Tick() + Duration * pSelf->Server()->TickSpeed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,6 +99,8 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos)
|
||||||
Controller->m_Teams.SendTeamsState(GetPlayer()->GetCID());
|
Controller->m_Teams.SendTeamsState(GetPlayer()->GetCID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_DefEmote = EMOTE_NORMAL;
|
||||||
|
m_DefEmoteReset = -1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -766,6 +768,13 @@ void CCharacter::Tick()
|
||||||
m_Core.Tick(true);
|
m_Core.Tick(true);
|
||||||
m_Core.m_Id = GetPlayer()->GetCID();
|
m_Core.m_Id = GetPlayer()->GetCID();
|
||||||
|
|
||||||
|
if (m_DefEmoteReset >= 0 && m_DefEmoteReset <= Server()->Tick())
|
||||||
|
{
|
||||||
|
m_DefEmoteReset = -1;
|
||||||
|
m_EmoteType = m_DefEmote = EMOTE_NORMAL;
|
||||||
|
m_EmoteStop = -1;
|
||||||
|
}
|
||||||
|
|
||||||
m_DoSplash = false;
|
m_DoSplash = false;
|
||||||
if (g_Config.m_SvEndlessDrag)
|
if (g_Config.m_SvEndlessDrag)
|
||||||
m_Core.m_HookTick = 0;
|
m_Core.m_HookTick = 0;
|
||||||
|
@ -1552,7 +1561,7 @@ void CCharacter::Snap(int SnappingClient)
|
||||||
// set emote
|
// set emote
|
||||||
if (m_EmoteStop < Server()->Tick())
|
if (m_EmoteStop < Server()->Tick())
|
||||||
{
|
{
|
||||||
m_EmoteType = EMOTE_NORMAL;
|
m_EmoteType = m_DefEmote;
|
||||||
m_EmoteStop = -1;
|
m_EmoteStop = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -145,6 +145,9 @@ public:
|
||||||
int m_EmoteType;
|
int m_EmoteType;
|
||||||
int m_EmoteStop;
|
int m_EmoteStop;
|
||||||
|
|
||||||
|
int m_DefEmote; //used to override the default emote through /emote
|
||||||
|
int m_DefEmoteReset; //tick when it gets reset
|
||||||
|
|
||||||
// last tick that the player took any action ie some input
|
// last tick that the player took any action ie some input
|
||||||
int m_LastAction;
|
int m_LastAction;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue