Fix memory corruption bugs due the array index out of bounds. (#147)

This commit is contained in:
s1lentq 2017-05-04 17:49:28 +03:00 committed by GitHub
parent 3f4bcd9b96
commit 3a1e08abd4

View File

@ -1589,11 +1589,21 @@ bool BotChatterInterface::ShouldSpeak() const
float BotChatterInterface::GetRadioSilenceDuration()
{
return IMPL(m_radioSilenceInterval)[ m_me->m_iTeam - 1 ].GetElapsedTime();
#ifdef REGAMEDLL_FIXES
if (m_me->m_iTeam != CT && m_me->m_iTeam != TERRORIST)
return 0;
#endif
return IMPL(m_radioSilenceInterval)[m_me->m_iTeam - 1].GetElapsedTime();
}
void BotChatterInterface::ResetRadioSilenceDuration()
{
#ifdef REGAMEDLL_FIXES
if (m_me->m_iTeam != CT && m_me->m_iTeam != TERRORIST)
return;
#endif
IMPL(m_radioSilenceInterval)[m_me->m_iTeam - 1].Reset();
}