Clamp /emote duration

/home/teeworlds/src/master/src/game/server/ddracechat.cpp:1108:65: runtime error: signed integer overflow: 99999999 * 50 cannot be represented in type 'int'
This commit is contained in:
def 2020-10-20 16:46:23 +02:00
parent c1dea54d80
commit 655bbd2cb6

View file

@ -1103,7 +1103,7 @@ void CGameContext::ConEyeEmote(IConsole::IResult *pResult, void *pUserData)
int Duration = 1;
if(pResult->NumArguments() > 1)
Duration = pResult->GetInteger(1);
Duration = clamp(pResult->GetInteger(1), 1, 86400);
pPlayer->m_DefEmoteReset = pSelf->Server()->Tick() + Duration * pSelf->Server()->TickSpeed();
pPlayer->m_LastEyeEmote = pSelf->Server()->Tick();