here is what im trying to convert to a switch...im thinking that maybe a switch stament would be faster.
Code:
//===================================================================================
int penetrate;
bool CorrectGun()
{
if(currentWeaponID==WEAPON_DEAGLE, currentWeaponID==WEAPON_SIG, currentWeaponID==WEAPON_COLT, currentWeaponID==WEAPON_PARA, currentWeaponID==WEAPON_AK, currentWeaponID==WEAPON_AUG, currentWeaponID==WEAPON_SG550, currentWeaponID==WEAPON_G3SG1)
{
penetrate = WALL_PEN1;
return true;
}
else if(currentWeaponID==WEAPON_SCOUT, currentWeaponID==WEAPON_AWP)
{
penetrate = WALL_PEN2;
return true;
}
else
{
penetrate = WALL_PEN0;
return true;
}
}
//===================================================================================
int CurPenetration(void)
{
if (CorrectGun())
return penetrate;
return WALL_PEN0;
}