Add autoshoot

If this cvar is enabled (1), and the aimbot is enabled (fov>0), it will
stop attacking if there is no visible target.
This commit is contained in:
8dcc
2023-07-31 18:03:26 +02:00
parent 83278b9983
commit 3414d131f4
3 changed files with 6 additions and 0 deletions

View File

@@ -94,6 +94,9 @@ void aimbot(usercmd_t* cmd) {
engine_viewangles.x += best_delta.x;
engine_viewangles.y += best_delta.y;
engine_viewangles.z += best_delta.z;
} else if (CVAR_ON(autoshoot)) {
/* No valid target and we have autoshoot, don't shoot */
cmd->buttons &= ~IN_ATTACK;
}
vec_copy(cmd->viewangles, engine_viewangles);