I suspect vec_set(gun_target, Gun_muzzle); may be the prob (I'm no coder though) which means that the target sprite would be at the gun muzzle and not the gun_target and if its their but not passable, it would slow down your character.

Might need advanced coders to sort this for you

Set it to the pistol.x maybe.