Allow bots to switch to knife or pistol + less useless reloads

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6322 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lucas GAUTHERON
2011-04-24 19:11:10 +00:00
parent 3712231df3
commit 6eeafb0695
3 changed files with 25 additions and 12 deletions
+5 -1
View File
@@ -284,9 +284,13 @@ float CBot::GetDistance(entity *e)
bool CBot::SelectGun(int Gun)
{
if(m_pMyEnt->weaponsel->reloading) return false;
if(m_pMyEnt->weaponsel->reloading || m_pMyEnt->weaponchanging) return false;
if (m_pMyEnt->gunselect != Gun) audiomgr.playsound(S_GUNCHANGE, m_pMyEnt);
m_pMyEnt->gunselect = Gun;
if(m_pMyEnt->weaponsel->type != Gun)
{
m_pMyEnt->weaponswitch(m_pMyEnt->weapons[Gun]);
}
return true;
}