- Duke/RR: Use the exact same trajectory for autoaiming and the actual attack hitscan for the pistol.

These were not identical so the pistol was likely to miss small targets the autoaim acquired. This was particularly bad for Duke's ceiling turret and RR's mosquito.
This commit is contained in:
Christoph Oelckers 2023-05-01 22:49:07 +02:00
parent 94a80dda11
commit fa1e667140
2 changed files with 2 additions and 4 deletions

View file

@ -209,7 +209,7 @@ DDukeActor* aim(DDukeActor* actor, int abase, bool force)
{ {
// Some fudging to avoid aim randomization when autoaim is off. // Some fudging to avoid aim randomization when autoaim is off.
// This is a reimplementation of how it was solved in RedNukem. // This is a reimplementation of how it was solved in RedNukem.
if (plr->curr_weapon == PISTOL_WEAPON && !isWW2GI()) if (plr->curr_weapon == PISTOL_WEAPON && !isWW2GI() && 0)
{ {
double vel = 1024, zvel = 0; double vel = 1024, zvel = 0;
setFreeAimVelocity(vel, zvel, plr->Angles.getPitchWithView(), 16.); setFreeAimVelocity(vel, zvel, plr->Angles.getPitchWithView(), 16.);

View file

@ -48,9 +48,7 @@ extend class DukeActor
let aimed = actor.aim(self, aimangle); let aimed = actor.aim(self, aimangle);
if (aimed) if (aimed)
{ {
double dal = ((aimed.scale.X * aimed.spriteHeight()) * 0.5) + aimed.sparkoffset; [vel, zvel] = Raze.setFreeAimVelocity(vel, zvel, p.getPitchWithView(), 16.);
double dist = (p.actor.pos.XY - aimed.pos.XY).Length();
zvel = ((aimed.pos.Z - pos.Z - dal) * 16) / dist;
ang = (aimed.pos - pos).Angle(); ang = (aimed.pos - pos).Angle();
} }