From a77ad02445efdc73ebb726b08ee392bef7d236b2 Mon Sep 17 00:00:00 2001 From: Dremor8484 <104323765+Dremor8484@users.noreply.github.com> Date: Sat, 3 Dec 2022 15:27:40 +0100 Subject: [PATCH] Update weapon.c the aimfix was working only on half of the attack, since the supershotgun shoots 2 times (half bullets left, half bullets right) --- src/game/player/weapon.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/game/player/weapon.c b/src/game/player/weapon.c index b08430b7..5db8d92d 100644 --- a/src/game/player/weapon.c +++ b/src/game/player/weapon.c @@ -1684,9 +1684,22 @@ weapon_supershotgun_fire(edict_t *ent) v[YAW] = ent->client->v_angle[YAW] - 5; v[ROLL] = ent->client->v_angle[ROLL]; AngleVectors(v, forward, NULL, NULL); + + if (aimfix->value) + { + AngleVectors(v, forward, right, NULL); + + VectorScale(forward, -2, ent->client->kick_origin); + ent->client->kick_angles[0] = -2; + + VectorSet(offset, 0, 8, ent->viewheight - 8); + P_ProjectSource(ent, offset, forward, right, start); + } + fire_shotgun(ent, start, forward, damage, kick, DEFAULT_SHOTGUN_HSPREAD, DEFAULT_SHOTGUN_VSPREAD, DEFAULT_SSHOTGUN_COUNT / 2, MOD_SSHOTGUN); + v[YAW] = ent->client->v_angle[YAW] + 5; AngleVectors(v, forward, NULL, NULL);