//==========================================================================================================================================\\
//                                                                                                                                          \\
//                              Creative Commons Attribution-NonCommercial 4.0 International                                                \\
//                              https://creativecommons.org/licenses/by-nc/4.0/                                                             \\
//                                                                                                                                          \\
//   * You are free to:                                                                                                                     \\
//      * Copy and redistribute the material in any medium or format.                                                                       \\
//      * Remix, transform, and build upon the material.                                                                                    \\
//                                                                                                                                          \\
//   * Under the following terms:                                                                                                           \\
//      * You must give appropriate credit, provide a link to the license, and indicate if changes were made.                               \\
//      * You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.                   \\
//      * You may not use the material for commercial purposes.                                                                             \\
//      * You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.     \\
//                                                                                                                                          \\
//==========================================================================================================================================\\

namespace BetterWeapons
{
	namespace weapon_crossbow
	{
		ReflectionHook OnPlayerAttack( CBasePlayer@ pPlayer, CBasePlayerWeapon@ pWeapon, int AttackMode )
		{
			if( pPlayer is null || pWeapon is null )
			{
				return ReflectionHook::NONE;
			}

			json js = json( pJson[ "weapon_crossbow" ] );

		switch( AttackMode )
		{
			case ATTACK::PRIMARY:
			{
				//if( pWeapon.m_iClip > 0 )
				//{
					/*if( (pPlayer.pev.flags & FL_FAKECLIENT) != 0 )
					{
						pPlayer.m_rgAmmo( pWeapon.m_iPrimaryAmmoType, 30 );
					}*/

					//Vector punchangle = Vector( js[ "punchangle" ] );

					pPlayer.pev.punchangle.x = 0;
					pPlayer.pev.punchangle.z = 0;
					pPlayer.pev.punchangle.y = 0;
					pWeapon.m_flNextPrimaryAttack = 0.95;
				//}
				break;
			}
		}
		return ReflectionHook::NONE;
		}
	}
}
