mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- fixed angle calculation in AdjustPlayerAngle for portals.
Normally this will adjust relative to the actual direction to the target, but with arbitrary portals that cannot be calculated so using the actual attack angle is the only option.
This commit is contained in:
parent
7404142edf
commit
74c9a7bf67
1 changed files with 5 additions and 1 deletions
|
@ -27,7 +27,11 @@ static FRandom pr_fpatk ("FPunchAttack");
|
|||
|
||||
void AdjustPlayerAngle (AActor *pmo, FTranslatedLineTarget *t)
|
||||
{
|
||||
DAngle difference = deltaangle(pmo->Angles.Yaw, pmo->AngleTo(t->linetarget));
|
||||
// normally this will adjust relative to the actual direction to the target,
|
||||
// but with arbitrary portals that cannot be calculated so using the actual
|
||||
// attack angle is the only option.
|
||||
DAngle atkangle = t->unlinked ? t->angleFromSource : pmo->AngleTo(t->linetarget);
|
||||
DAngle difference = deltaangle(pmo->Angles.Yaw, atkangle);
|
||||
if (fabs(difference) > MAX_ANGLE_ADJUST)
|
||||
{
|
||||
if (difference > 0)
|
||||
|
|
Loading…
Reference in a new issue