Update weapon.c

phalanx aimfix (like the supershotgun)
the first shot (in the if statement) is to the right, the second shot (in the else statement) shoots left

without the change to the code 1 shot is centered on the aim cross, the other is on the right
with the change to the code the left shot is on the left of the crossair and it touches the left -- of the crossair, while the right shot is on the right and touches the right -- of the crossair
This commit is contained in:
Dremor8484 2022-12-16 04:27:38 +01:00 committed by GitHub
parent 92d83faff4
commit 04868b72ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 0 deletions

View File

@ -2159,6 +2159,17 @@ weapon_phalanx_fire(edict_t *ent)
v[ROLL] = ent->client->v_angle[ROLL];
AngleVectors(v, forward, right, up);
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);
}
radius_damage = 30;
damage_radius = 120;
@ -2176,6 +2187,18 @@ weapon_phalanx_fire(edict_t *ent)
v[YAW] = ent->client->v_angle[YAW] + 1.5;
v[ROLL] = ent->client->v_angle[ROLL];
AngleVectors(v, forward, right, up);
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_plasma(ent, start, forward, damage, 725,
damage_radius, radius_damage);