mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-30 07:41:22 +00:00
- restored the velocity threshold checks in A_MaceBallImpact2 and A_DeathBallImpact to their original Heretic form, minus the check for floorz, to account for potential positioning issues with slopes.
These checks had some major issues: * they calculated incorrect positive values for hitting a ceiling * the way they used the plane equations made some incorrect assumptions. * velz has the velocity reduction from bouncing already factored in from the calling code so doing it here again is not necessary.
This commit is contained in:
parent
fe271b4e78
commit
08e5e1c145
1 changed files with 2 additions and 30 deletions
|
@ -512,21 +512,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact2)
|
||||||
}
|
}
|
||||||
if (self->flags & MF_INBOUNCE)
|
if (self->flags & MF_INBOUNCE)
|
||||||
{
|
{
|
||||||
fixed_t floordist = self->Z() - self->floorz;
|
if (self->velz < 2*FRACUNIT)
|
||||||
fixed_t ceildist = self->ceilingz - self->Z();
|
|
||||||
fixed_t vel;
|
|
||||||
|
|
||||||
// NOTE: The assumptions being made here about the plane to use for bouncing off are dead wrong.
|
|
||||||
// http://forum.zdoom.org/viewtopic.php?f=2&t=50449
|
|
||||||
if (floordist <= ceildist)
|
|
||||||
{
|
|
||||||
vel = MulScale32 (self->velz, self->Sector->floorplane.c);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vel = MulScale32 (self->velz, self->Sector->ceilingplane.c);
|
|
||||||
}
|
|
||||||
if (vel < 2)
|
|
||||||
{
|
{
|
||||||
goto boom;
|
goto boom;
|
||||||
}
|
}
|
||||||
|
@ -624,21 +610,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact)
|
||||||
}
|
}
|
||||||
if (self->flags & MF_INBOUNCE)
|
if (self->flags & MF_INBOUNCE)
|
||||||
{
|
{
|
||||||
fixed_t floordist = self->Z() - self->floorz;
|
if (self->velz < 2*FRACUNIT)
|
||||||
fixed_t ceildist = self->ceilingz - self->Z();
|
|
||||||
fixed_t vel;
|
|
||||||
|
|
||||||
// NOTE: The assumptions being made here about the plane to use for bouncing off are dead wrong.
|
|
||||||
// http://forum.zdoom.org/viewtopic.php?f=2&t=50449
|
|
||||||
if (floordist <= ceildist)
|
|
||||||
{
|
|
||||||
vel = MulScale32 (self->velz, self->Sector->floorplane.c);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vel = MulScale32 (self->velz, self->Sector->ceilingplane.c);
|
|
||||||
}
|
|
||||||
if (vel < 2)
|
|
||||||
{
|
{
|
||||||
goto boom;
|
goto boom;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue