mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- Fixed: MIRRORREFLECT was broken after my last patch to fix the always 0 angle issue. Also simplified the speed change -- it's the same thing without having to recalculate the angle into it.
- Also ensure that the check for AIMREFLECT happens no matter what.
This commit is contained in:
parent
b69edbbec1
commit
6bb0849984
1 changed files with 27 additions and 15 deletions
|
@ -1968,8 +1968,6 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
|||
// Don't change the angle if there's THRUREFLECT on the monster.
|
||||
if (!(BlockingMobj->flags7 & MF7_THRUREFLECT))
|
||||
{
|
||||
//int dir;
|
||||
//angle_t delta;
|
||||
angle = R_PointToAngle2(BlockingMobj->x, BlockingMobj->y, mo->x, mo->y);
|
||||
bool dontReflect = (mo->AdjustReflectionAngle(BlockingMobj, angle));
|
||||
// Change angle for deflection/reflection
|
||||
|
@ -1996,12 +1994,21 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
|||
}
|
||||
else
|
||||
{
|
||||
|
||||
mo->angle = angle;
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
mo->velx = FixedMul(mo->Speed >> 1, finecosine[angle]);
|
||||
mo->vely = FixedMul(mo->Speed >> 1, finesine[angle]);
|
||||
mo->velz = -mo->velz / 2;
|
||||
if (BlockingMobj->flags7 & MF7_MIRRORREFLECT && (tg || blockingtg))
|
||||
{
|
||||
mo->angle += ANGLE_180;
|
||||
mo->velx = -mo->velx / 2;
|
||||
mo->vely = -mo->vely / 2;
|
||||
mo->velz = -mo->velz / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
mo->angle = angle;
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
mo->velx = FixedMul(mo->Speed >> 1, finecosine[angle]);
|
||||
mo->vely = FixedMul(mo->Speed >> 1, finesine[angle]);
|
||||
mo->velz = -mo->velz / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2932,11 +2939,8 @@ bool AActor::AdjustReflectionAngle (AActor *thing, angle_t &angle)
|
|||
{
|
||||
if (flags2 & MF2_DONTREFLECT) return true;
|
||||
if (thing->flags7 & MF7_THRUREFLECT) return false;
|
||||
|
||||
if (thing->flags7 & MF7_MIRRORREFLECT)
|
||||
angle += ANGLE_180;
|
||||
// Change angle for reflection
|
||||
else if (thing->flags4&MF4_SHIELDREFLECT)
|
||||
if (thing->flags4&MF4_SHIELDREFLECT)
|
||||
{
|
||||
// Shield reflection (from the Centaur
|
||||
if (abs (angle - thing->angle)>>24 > 45)
|
||||
|
@ -2959,15 +2963,23 @@ bool AActor::AdjustReflectionAngle (AActor *thing, angle_t &angle)
|
|||
else
|
||||
angle -= ANG45;
|
||||
}
|
||||
else if (thing->flags7 & MF7_AIMREFLECT)
|
||||
else
|
||||
{
|
||||
angle += ANGLE_1 * ((pr_reflect() % 16) - 8);
|
||||
}
|
||||
//Always check for AIMREFLECT, no matter what else is checked above.
|
||||
if (thing->flags7 & MF7_AIMREFLECT)
|
||||
{
|
||||
if (this->target != NULL)
|
||||
{
|
||||
A_Face(this, this->target);
|
||||
}
|
||||
else if (thing->target != NULL)
|
||||
{
|
||||
A_Face(this, thing->target);
|
||||
}
|
||||
}
|
||||
else
|
||||
angle += ANGLE_1 * ((pr_reflect()%16)-8);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue