mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 14:41:55 +00:00
- relaxed the FindWall check for wall sprites a bit so that slightly out-of-sector sprites can find a wall to attach to.
This commit is contained in:
parent
0bfb4abc1c
commit
6807086f3c
1 changed files with 22 additions and 3 deletions
|
@ -67,10 +67,29 @@ static walltype* IsOnWall(tspritetype* tspr, int height, DVector2& outpos)
|
|||
// angle of the sprite must either be the wall's normal or the negative wall's normal to be aligned.
|
||||
if (deltaang >= 512 - maxangdelta && deltaang <= 512 + maxangdelta)
|
||||
{
|
||||
double wdist = SquareDistToWall(tspr->pos.X, tspr->pos.Y, &wal, &outpos);
|
||||
if (wdist <= maxdistsq)
|
||||
// orthogonal lines do not check the actual position so that certain off-sector sprites get handled properly.
|
||||
// In Wanton Destruction's airplane level there's such a sprite assigned to the wrong sector.
|
||||
if (d.X == 0)
|
||||
{
|
||||
closest = &wal;
|
||||
if (tspr->pos.X == wal.pos.X)
|
||||
{
|
||||
closest = &wal;
|
||||
}
|
||||
}
|
||||
else if (d.Y == 0)
|
||||
{
|
||||
if (tspr->pos.Y == wal.pos.Y)
|
||||
{
|
||||
closest = &wal;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
double wdist = SquareDistToWall(tspr->pos.X, tspr->pos.Y, &wal, &outpos);
|
||||
if (wdist <= maxdistsq)
|
||||
{
|
||||
closest = &wal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue