mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 20:42:11 +00:00
- Duke: Pitch-adjusted velocity for shootrpg()
when free-aiming.
This commit is contained in:
parent
8ec475aec8
commit
33e2de70a2
2 changed files with 7 additions and 1 deletions
|
@ -523,4 +523,10 @@ inline DAngle ClampViewPitch(const DAngle pitch)
|
|||
return clamp(pitch, GetMaxPitch(), GetMinPitch());
|
||||
}
|
||||
|
||||
inline void setFreeAimVelocity(double& vel, double& zvel, const DAngle pitch, const double zvspeed)
|
||||
{
|
||||
vel *= pitch.Cos();
|
||||
zvel = pitch.Sin() * zvspeed;
|
||||
}
|
||||
|
||||
#include "updatesector.h"
|
||||
|
|
|
@ -683,7 +683,7 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw
|
|||
ang = (aimed->spr.pos.XY() - pos.XY()).Angle();
|
||||
}
|
||||
else
|
||||
zvel = ps[p].horizon.sum().Tan() * 40.5;
|
||||
setFreeAimVelocity(vel, zvel, ps[p].horizon.sum(), 40.5);
|
||||
|
||||
if (atwith == RPG)
|
||||
S_PlayActorSound(RPG_SHOOT, actor);
|
||||
|
|
Loading…
Reference in a new issue