Originally Posted by
__Xen0
Well, it's moving in the direction the silent aim is aiming at. But I think I am getting a clue. (Hardy Boys reference)
Exactly. You only need to stop movement WHILE aiming at someone.
The smarter folk would realize that you only need to apply aiming when you're firing a bullet ( Which takes x milliseconds depending on the weapondef )
Code:
void Hook(){
static int s_lastFireTime = 0;
auto c = input::Instance()->GetCmd( input::Instance()->cmdNum );
if( !CAim::Instance()->IsAiming )
return;
if( ( s_lastFireTime - Com_Milliseconds() ) > Engine::GetWeaponVariantDef( c->weaponId )->fireTime ){
c->angles[ PITCH ] += ANGLE2SHORT( CAim::Instance()->aimAngles[ PITCH ] );
c->angles[ YAW ] += ANGLE2SHORT( CAim::Instance()->aimAngles[ YAW ] );
c->angles[ ROLL ] += ANGLE2SHORT( CAim::Instance()->aimAngles[ ROLL ] );
c->button_bits |= BUTTON_ATTACK;
s_lastFireTime = Com_Milliseconds();
}
}