MCPcopy Create free account
hub / github.com/assaultcube/AC / GetShootDelay

Method GetShootDelay

source/src/bot/bot_ai.cpp:699–710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

697}
698
699int CBot::GetShootDelay()
700{
701 // UNDONE
702 return m_pMyEnt->gunwait[m_pMyEnt->gunselect];
703 if ((WeaponInfoTable[m_pMyEnt->gunselect].eWeaponType == TYPE_MELEE) ||
704 (WeaponInfoTable[m_pMyEnt->gunselect].eWeaponType == TYPE_AUTO))
705 return m_pMyEnt->gunwait[m_pMyEnt->gunselect];
706
707 float flMinShootDelay = m_pBotSkill->flMinAttackDelay;
708 float flMaxShootDelay = m_pBotSkill->flMaxAttackDelay;
709 return max(m_pMyEnt->gunwait[m_pMyEnt->gunselect], int(RandomFloat(flMinShootDelay, flMaxShootDelay) * 1000.0f));
710}
711
712void CBot::CheckReload() // reload gun if no enemies are around
713{

Callers

nothing calls this directly

Calls 2

maxFunction · 0.85
RandomFloatFunction · 0.85

Tested by

no test coverage detected