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

Method Spawn

source/src/bot/bot.cpp:38–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38void CBot::Spawn()
39{
40 // Init all bot variabeles
41 spawnplayer(m_pMyEnt);
42
43 m_pMyEnt->targetyaw = m_pMyEnt->targetpitch = 0.0f;
44 m_pMyEnt->enemy = NULL;
45 m_pMyEnt->maxspeed = 22.0f;
46 m_pMyEnt->pBot = this;
47
48 m_eCurrentBotState = STATE_NORMAL;
49 m_iShootDelay = m_iChangeWeaponDelay = 0;
50 m_iCheckEnvDelay = 0;
51 m_vPrevOrigin = g_vecZero;
52 m_iStuckCheckDelay = lastmillis + 250;
53 m_bStuck = false;
54 m_iStuckTime = 0;
55 m_iStrafeTime = m_iStrafeCheckDelay = 0;
56 m_iMoveDir = DIR_NONE;
57
58 m_pPrevEnemy = NULL;
59 m_iCombatNavTime = 0;
60 m_iSPMoveTime = 0;
61 m_iEnemySearchDelay = 0;
62 m_iSawEnemyTime = 0;
63 m_bCombatJump = false;
64 m_iCombatJumpDelay = 0;
65 m_iHuntDelay = 0;
66 m_vHuntLocation = m_vPrevHuntLocation = g_vecZero;
67 m_pHuntTarget = NULL;
68 m_fPrevHuntDist = 0.0f;
69 m_iHuntLastTurnLessTime = m_iHuntPlayerUpdateTime = m_iHuntPauseTime = 0;
70 m_iLookAroundDelay = m_iLookAroundTime = m_iLookAroundUpdateTime = 0;
71 m_fLookAroundYaw = 0.0f;
72 m_bLookLeft = false;
73
74 m_iLastJumpPad = 0;
75 m_pTargetEnt = NULL;
76 while(!m_UnreachableEnts.Empty()) delete m_UnreachableEnts.Pop();
77 m_iCheckTeleporterDelay = m_iCheckJumppadsDelay = 0;
78 m_iCheckEntsDelay = 0;
79 m_iCheckTriggersDelay = 0;
80 m_iLookForWaypointTime = 0;
81
82 m_iAimDelay = 0;
83 m_fYawToTurn = m_fPitchToTurn = 0.0f;
84
85 m_vGoal = m_vWaterGoal = g_vecZero;
86
87 ResetWaypointVars();
88}
89
90void CBot::Think()
91{

Callers 2

CreateBotMethod · 0.45
RespawnBotsMethod · 0.45

Calls 3

spawnplayerFunction · 0.85
EmptyMethod · 0.45
PopMethod · 0.45

Tested by

no test coverage detected