
void UpdateWeaponData()
{
	float flSpeed = (float)sqrt(me.pmVelocity[0] * me.pmVelocity[0] + me.pmVelocity[1] * me.pmVelocity[1]);
	//

	switch (me.currentWeaponID)
	{
		case WEAPONLIST_USP:
		{
			Spread.iPenetration = WALL_PEN0;
			Spread.flPenetrationDistance = 4096.0f;
			Spread.flWallPierce1 = 0.79f; // unsilenced
			Spread.flWallPierce2 = 0.79f; // silenced
			Spread.iDamage1 = 34; // unsilenced
			Spread.iDamage2 = 30; // silenced
			Spread.iBulletType = BULLET_PLAYER_45ACP;

//#define USP_SILENCER (1 << 0)
			if ((Spread.m_iWeaponState & (1 << 0)))
			{
				if (!(Spread.m_iFlags & FL_ONGROUND))
					Spread.m_flSpread = 1.3 * (1 - Spread.m_flAccuracy);
				else if (flSpeed > 0)
					Spread.m_flSpread = 0.25 * (1 - Spread.m_flAccuracy);
				else if (Spread.m_iFlags & FL_DUCKING)
					Spread.m_flSpread = 0.125 * (1 - Spread.m_flAccuracy);
				else
					Spread.m_flSpread = 0.15 * (1 - Spread.m_flAccuracy);
			}
			else
			{
				if (!(Spread.m_iFlags & FL_ONGROUND))
					Spread.m_flSpread = 1.2 * (1 - Spread.m_flAccuracy);
				else if (flSpeed > 0)
					Spread.m_flSpread = 0.225 * (1 - Spread.m_flAccuracy);
				else if (Spread.m_iFlags & FL_DUCKING)
					Spread.m_flSpread = 0.08 * (1 - Spread.m_flAccuracy);
				else
					Spread.m_flSpread = 0.1 * (1 - Spread.m_flAccuracy);
			}
		}
		break;

		case WEAPONLIST_DEAGLE:
		{
			Spread.iPenetration = WALL_PEN1;
			Spread.flPenetrationDistance = 4096.0f;
			Spread.flWallPierce1 = 0.81f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 54;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_50AE;

			if (!(Spread.m_iFlags & FL_ONGROUND))
				Spread.m_flSpread = 1.5 * (1 - Spread.m_flAccuracy);
			else if (flSpeed > 0)
				Spread.m_flSpread = 0.25 * (1 - Spread.m_flAccuracy);
			else if (Spread.m_iFlags & FL_DUCKING)
				Spread.m_flSpread = 0.115 * (1 - Spread.m_flAccuracy);
			else
				Spread.m_flSpread = 0.13 * (1 - Spread.m_flAccuracy);
		}
		break;

		case WEAPONLIST_GLOCK18:
		{
			Spread.iPenetration = WALL_PEN0;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.75f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 20;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_9MM;

//#define GLOCK18_BURST (1 << 1)
			if ((Spread.m_iWeaponState & (1 << 1)))
			{
				if (!(Spread.m_iFlags & FL_ONGROUND))
					Spread.m_flSpread = 1.2 * (1 - Spread.m_flAccuracy);
				else if (flSpeed > 0)
					Spread.m_flSpread = 0.185 * (1 - Spread.m_flAccuracy);
				else if (Spread.m_iFlags & FL_DUCKING)
					Spread.m_flSpread = 0.095 * (1 - Spread.m_flAccuracy);
				else
					Spread.m_flSpread = 0.3 * (1 - Spread.m_flAccuracy);
			}
			else
			{
				if (!(Spread.m_iFlags & FL_ONGROUND))
					Spread.m_flSpread = 1.0 * (1 - Spread.m_flAccuracy);
				else if (flSpeed > 0)
					Spread.m_flSpread = 0.165 * (1 - Spread.m_flAccuracy);
				else if (Spread.m_iFlags & FL_DUCKING)
					Spread.m_flSpread = 0.075 * (1 - Spread.m_flAccuracy);
				else
					Spread.m_flSpread = 0.1 * (1 - Spread.m_flAccuracy);
			}
		}
		break;

		case WEAPONLIST_P228:
		{
			Spread.iPenetration = WALL_PEN0;
			Spread.flPenetrationDistance = 4096.0f;
			Spread.flWallPierce1 = 0.8f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 32;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_357SIG;

			if (!(Spread.m_iFlags & FL_ONGROUND))
				Spread.m_flSpread = 1.5 * (1 - Spread.m_flAccuracy);
			else if (flSpeed > 0)
				Spread.m_flSpread = 0.255 * (1 - Spread.m_flAccuracy);
			else if (Spread.m_iFlags & FL_DUCKING)
				Spread.m_flSpread = 0.075 * (1 - Spread.m_flAccuracy);
			else
				Spread.m_flSpread = 0.15 * (1 - Spread.m_flAccuracy);
		}
		break;

		case WEAPONLIST_ELITE:
		{
			Spread.iPenetration = WALL_PEN0;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.75f; // left
			Spread.flWallPierce2 = 0.75f; // right
			Spread.iDamage1 = 20; // left
			Spread.iDamage2 = 27; // right
			Spread.iBulletType = BULLET_PLAYER_9MM;

			if (!(Spread.m_iFlags & FL_ONGROUND))
				Spread.m_flSpread = 1.3 * (1 - Spread.m_flAccuracy);
			else if (flSpeed > 0)
				Spread.m_flSpread = 0.175 * (1 - Spread.m_flAccuracy);
			else if (Spread.m_iFlags & FL_DUCKING)
				Spread.m_flSpread = 0.08 * (1 - Spread.m_flAccuracy);
			else
				Spread.m_flSpread = 0.1 * (1 - Spread.m_flAccuracy);
		}
		break;

		case WEAPONLIST_FIVESEVEN:
		{
			Spread.iPenetration = WALL_PEN0;
			Spread.flPenetrationDistance = 4096.0f;
			Spread.flWallPierce1 = 0.885f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 14;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_357SIG;

			if (!(Spread.m_iFlags & FL_ONGROUND))
				Spread.m_flSpread = 1.5 * (1 - Spread.m_flAccuracy);
			else if (flSpeed > 0)
				Spread.m_flSpread = 0.255 * (1 - Spread.m_flAccuracy);
			else if (Spread.m_iFlags & FL_DUCKING)
				Spread.m_flSpread = 0.075 * (1 - Spread.m_flAccuracy);
			else
				Spread.m_flSpread = 0.15 * (1 - Spread.m_flAccuracy);
		}
		break;

		/////////////////////////////////////////


		case WEAPONLIST_AWP:
		{
			Spread.iPenetration = WALL_PEN2;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.99f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 115;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_338MAG;

			if (!(Spread.m_iFlags & FL_ONGROUND))
				Spread.m_flSpread = 0.85;
			else if (flSpeed > 140)
				Spread.m_flSpread = 0.25;
			else if (flSpeed > 10)
				Spread.m_flSpread = 0.1;
			else if (Spread.m_iFlags & FL_DUCKING)
				Spread.m_flSpread = 0.0;
			else
				Spread.m_flSpread = 0.001;

			if (me.iFOV == 90)
				Spread.m_flSpread += 0.08f;
		}
		break;

		case WEAPONLIST_SCOUT:
		{
			Spread.iPenetration = WALL_PEN2;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.98f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 75;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_762MM;

			if (!(Spread.m_iFlags & FL_ONGROUND))
				Spread.m_flSpread = 0.2;
			else if (flSpeed > 170)
				Spread.m_flSpread = 0.075;
			else if (Spread.m_iFlags & FL_DUCKING)
				Spread.m_flSpread = 0;
			else
				Spread.m_flSpread = 0.007;

			if (me.iFOV == 90)
				Spread.m_flSpread += 0.025f;
		}
		break;

		

		case WEAPONLIST_G3SG1:
		{
			Spread.iPenetration = WALL_PEN1;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.98f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 60;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_762MM;

			if (!(Spread.m_iFlags & FL_ONGROUND))
				Spread.m_flSpread = 0.45;
			else if (flSpeed > 0)
				Spread.m_flSpread = 0.15;
			else if (Spread.m_iFlags & FL_DUCKING)
				Spread.m_flSpread = 0.035;
			else
				Spread.m_flSpread = 0.055;

			if (me.iFOV == 90)
				Spread.m_flSpread += 0.025f;
		}
		break;

		
		case WEAPONLIST_SG550:
		{
			Spread.iPenetration = WALL_PEN1;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.98f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 40;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_556MM;

			if (!(Spread.m_iFlags & FL_ONGROUND))
				Spread.m_flSpread = 0.45 * (1 - Spread.m_flAccuracy);
			else if (flSpeed > 0)
				Spread.m_flSpread = 0.15;
			else if (Spread.m_iFlags & FL_DUCKING)
				Spread.m_flSpread = 0.04 * (1 - Spread.m_flAccuracy);
			else
				Spread.m_flSpread = 0.05 * (1 - Spread.m_flAccuracy);

			if (me.iFOV == 90)
				Spread.m_flSpread += 0.025f;
		}
		break;

		case WEAPONLIST_SG552:
		{
			Spread.iPenetration = WALL_PEN1;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.955f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 33;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_556MM;

			if (!(Spread.m_iFlags & FL_ONGROUND))
				Spread.m_flSpread = Spread.m_flAccuracy * 0.45 + 0.035;
			else if (flSpeed > 140)
				Spread.m_flSpread = Spread.m_flAccuracy * 0.075 + 0.035;
			else
				Spread.m_flSpread = Spread.m_flAccuracy * 0.02;
		}
		break;

		/////////////////////////////////////////


		case WEAPONLIST_AK47:
		{
			Spread.iPenetration = WALL_PEN1;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.98f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 36;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_762MM;

			if (!(Spread.m_iFlags & FL_ONGROUND))
				Spread.m_flSpread = Spread.m_flAccuracy * 0.4 + 0.04;
			else if (flSpeed > 140)
				Spread.m_flSpread = Spread.m_flAccuracy * 0.07 + 0.04;
			else
				Spread.m_flSpread = Spread.m_flAccuracy * 0.0275;
		}
		break;

		

		case WEAPONLIST_M4A1:
		{
			Spread.iPenetration = WALL_PEN1;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.97f; // unsilenced
			Spread.flWallPierce2 = 0.95f; // silenced
			Spread.iDamage1 = 32; // unsilenced
			Spread.iDamage2 = 33; // silenced
			Spread.iBulletType = BULLET_PLAYER_556MM;

//#define M4A1_SILENCER (1 << 2)
			if ((Spread.m_iWeaponState & (1 << 2)))
			{
				if (!(Spread.m_iFlags & FL_ONGROUND))
					Spread.m_flSpread = Spread.m_flAccuracy * 0.4 + 0.035;
				else if (flSpeed > 140)
					Spread.m_flSpread = Spread.m_flAccuracy * 0.07 + 0.035;
				else
					Spread.m_flSpread = Spread.m_flAccuracy * 0.025;
			}
			else
			{
				if (!(Spread.m_iFlags & FL_ONGROUND))
					Spread.m_flSpread = Spread.m_flAccuracy * 0.4 + 0.035;
				else if (flSpeed > 140)
					Spread.m_flSpread = Spread.m_flAccuracy * 0.07 + 0.035;
				else
					Spread.m_flSpread = Spread.m_flAccuracy * 0.02;
			}
		}
		break;

		case WEAPONLIST_FAMAS:
		{
			Spread.iPenetration = WALL_PEN1;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.96f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 33;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_556MM;

			if (!(Spread.m_iFlags & FL_ONGROUND))
				Spread.m_flSpread = Spread.m_flAccuracy * 0.3 + 0.030;
			else if (flSpeed > 140)
				Spread.m_flSpread = Spread.m_flAccuracy * 0.07 + 0.030;
			else
				Spread.m_flSpread = Spread.m_flAccuracy * 0.02;

			if (!(Spread.m_iWeaponState & (FAMAS_BURST ))) Spread.m_flSpread += 0.01f;
		}
		break;

		case WEAPONLIST_GALIL:
		{
			Spread.iPenetration = WALL_PEN1;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.96f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 33;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_556MM;

			if (!(Spread.m_iFlags & FL_ONGROUND))
				Spread.m_flSpread = Spread.m_flAccuracy * 0.3 + 0.04;
			else if (flSpeed > 140)
				Spread.m_flSpread = Spread.m_flAccuracy * 0.07 + 0.04;
			else
				Spread.m_flSpread = Spread.m_flAccuracy * 0.0375;
		}
		break;

		/////////////////////////////////////////


		case WEAPONLIST_AUG:
		{
			Spread.iPenetration = WALL_PEN1;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.96f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 32;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_556MM;

			if (!(Spread.m_iFlags & FL_ONGROUND))
				Spread.m_flSpread = Spread.m_flAccuracy * 0.4 + 0.035;
			else if (flSpeed > 140)
				Spread.m_flSpread = Spread.m_flAccuracy * 0.07 + 0.035;
			else
				Spread.m_flSpread = Spread.m_flAccuracy * 0.02;
		}
		break;

		case WEAPONLIST_M249:
		{
			Spread.iPenetration = WALL_PEN1;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.97f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 32;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_556MM;

			if (!(Spread.m_iFlags & FL_ONGROUND))
				Spread.m_flSpread = Spread.m_flAccuracy * 0.5 + 0.045;
			else if (flSpeed > 140)
				Spread.m_flSpread = Spread.m_flAccuracy * 0.095 + 0.045;
			else
				Spread.m_flSpread = Spread.m_flAccuracy * 0.03;
		}
		break;

		/////////////////////////////////////////


		case WEAPONLIST_MAC10:
		{
			Spread.iPenetration = WALL_PEN0;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.82f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 29;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_45ACP;

			if (Spread.m_iFlags & FL_ONGROUND)
				Spread.m_flSpread = 0.03 * Spread.m_flAccuracy;
			else
				Spread.m_flSpread = 0.375 * Spread.m_flAccuracy;
		}
		break;

		case WEAPONLIST_P90:
		{
			Spread.iPenetration = WALL_PEN0;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.885f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 21;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_57MM;

			if (!(Spread.m_iFlags & FL_ONGROUND))
				Spread.m_flSpread = Spread.m_flAccuracy * 0.3;
			else if (flSpeed > 170)
				Spread.m_flSpread = Spread.m_flAccuracy * 0.115;
			else
				Spread.m_flSpread = Spread.m_flAccuracy * 0.045;
		}
		break;

		case WEAPONLIST_MP5:
		{
			Spread.iPenetration = WALL_PEN0;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.84f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 26;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_9MM;

			if (Spread.m_iFlags & FL_ONGROUND)
				Spread.m_flSpread = 0.04 * Spread.m_flAccuracy;
			else
				Spread.m_flSpread = 0.2 * Spread.m_flAccuracy;
		}
		break;

		case WEAPONLIST_TMP:
		{
			Spread.iPenetration = WALL_PEN0;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.85f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 20;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_9MM;

			if (Spread.m_iFlags & FL_ONGROUND)
				Spread.m_flSpread = 0.03 * Spread.m_flAccuracy;
			else
				Spread.m_flSpread = 0.25 * Spread.m_flAccuracy;
		}
		break;

		case WEAPONLIST_UMP45:
		{
			Spread.iPenetration = WALL_PEN0;
			Spread.flPenetrationDistance = 8192.0f;
			Spread.flWallPierce1 = 0.82f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 30;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_45ACP;

			if (Spread.m_iFlags & FL_ONGROUND)
				Spread.m_flSpread = 0.04 * Spread.m_flAccuracy;
			else
				Spread.m_flSpread = 0.24 * Spread.m_flAccuracy;
		}
		break;

		/////////////////////////////////////////


		case WEAPONLIST_M3:
		{
			Spread.iPenetration = WALL_PEN0;
			Spread.flPenetrationDistance = 3000.0f;
			Spread.flWallPierce1 = 0.0f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 4;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_BUCKSHOT;
			Spread.m_flSpread = 0.f;
		}
		break;

		case WEAPONLIST_XM1014:
		{
			Spread.iPenetration = WALL_PEN0;
			Spread.flPenetrationDistance = 3048.0f;
			Spread.flWallPierce1 = 0.0f;
			Spread.flWallPierce2 = 0.0f;
			Spread.iDamage1 = 4;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_PLAYER_BUCKSHOT;
			Spread.m_flSpread = 0;
		}
		break;

		/////////////////////////////////////////

		default:
		{
			Spread.iPenetration = WALL_PEN0;
			Spread.flPenetrationDistance = 0;
			Spread.flWallPierce1 = 0;
			Spread.flWallPierce2 = 0;
			Spread.iDamage1 = 0;
			Spread.iDamage2 = 0;
			Spread.iBulletType = BULLET_NONE;
			Spread.m_flAccuracy = 0;
			Spread.m_flSpread = 0;
		}
		break;
	}
}

























