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

Method SelectGun

source/src/bot/bot.cpp:283–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281}
282
283bool CBot::SelectGun(int Gun)
284{
285 if(!m_pMyEnt->weapons[Gun]->selectable()) return false;
286 if(m_pMyEnt->weaponsel->reloading || m_pMyEnt->weaponchanging) return false;
287 m_pMyEnt->gunselect = Gun;
288 if(m_pMyEnt->weaponsel->type != Gun)
289 {
290 m_pMyEnt->weaponswitch(m_pMyEnt->weapons[Gun]);
291 m_iChangeWeaponDelay = lastmillis + 1000;
292 }
293 return true;
294}
295
296bool CBot::IsVisible(entity *e, bool CheckPlayers)
297{

Callers

nothing calls this directly

Calls 2

selectableMethod · 0.80
weaponswitchMethod · 0.80

Tested by

no test coverage detected