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

View file

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