From 588ebb0ea847aae3a17ed54eded23cb998a89b19 Mon Sep 17 00:00:00 2001 From: Dremor8484 <104323765+Dremor8484@users.noreply.github.com> Date: Fri, 10 Jun 2022 19:23:47 +0200 Subject: [PATCH 1/2] Update weapon.c zaero-doublebarrelshotgun-aimfix --- src/player/weapon.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/player/weapon.c b/src/player/weapon.c index 3a12236..31aed19 100644 --- a/src/player/weapon.c +++ b/src/player/weapon.c @@ -1382,6 +1382,18 @@ void weapon_supershotgun_fire (edict_t *ent) 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); + + 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); // send muzzle flash From 4733f22e6f01ef469c7d7572faf70c70d1d93485 Mon Sep 17 00:00:00 2001 From: Dremor8484 <104323765+Dremor8484@users.noreply.github.com> Date: Sat, 3 Dec 2022 15:58:53 +0100 Subject: [PATCH 2/2] 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) to carefully test it i tried to comment out 1 of the 2 shots while also keep yaw change to 0 in 1 case the bullets hit around the crossair, in the other case the bullets were not centered around the crossair. i added the same fix to the shot that did not have it, and it worked. i tested it out with yaw-5 and yaw+5 with both shots shooting at the same time and the bullets appeared to gather into 2 distinct clusters one left side of crossair, one right side of crossair like 2 eyes on the wall --- src/player/weapon.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/player/weapon.c b/src/player/weapon.c index 31aed19..aba22e6 100644 --- a/src/player/weapon.c +++ b/src/player/weapon.c @@ -1379,7 +1379,20 @@ void 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);