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

Method CheckItems

source/src/bot/bot_ai.cpp:1783–1820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1781}
1782
1783bool CBot::CheckItems()
1784{
1785 if (!m_pCurrentGoalWaypoint && !CheckJump() && CheckStuck())
1786 {
1787 // Don't check for ents a while when stuck
1788 m_iCheckEntsDelay = lastmillis + RandomLong(1000, 2000);
1789 return false;
1790 }
1791
1792 if (m_vGoal==g_vecZero)
1793 m_pTargetEnt = NULL;
1794
1795 if (!m_pTargetEnt)
1796 {
1797 if (m_iCheckEntsDelay > lastmillis)
1798 return false;
1799 else
1800 {
1801 m_pTargetEnt = SearchForEnts(!m_classicsp);
1802 m_iCheckEntsDelay = lastmillis + RandomLong(2500, 5000);
1803 }
1804 }
1805
1806 if (m_pTargetEnt)
1807 {
1808 if (HeadToTargetEnt())
1809 return true;
1810 }
1811
1812 if (m_eCurrentBotState == STATE_ENT)
1813 {
1814 ResetWaypointVars();
1815 m_vGoal = g_vecZero;
1816 m_pTargetEnt = NULL;
1817 }
1818
1819 return false;
1820}
1821
1822bool CBot::InUnreachableList(entity *e)
1823{

Callers

nothing calls this directly

Calls 1

RandomLongFunction · 0.85

Tested by

no test coverage detected