- fixed FAFhitscan to not pass the hitpos back into hitscan.

This will overwrite the scan's start and cause the function to malfunction.
This commit is contained in:
Christoph Oelckers 2022-10-04 21:06:19 +02:00
parent 2991bc752b
commit babbad83af

View file

@ -177,7 +177,8 @@ void FAFhitscan(const DVector3& start, sectortype* sect, const DVector3& vect, H
ResetWallWarpHitscan(hit.hitSector);
// NOTE: This could be recursive I think if need be
hitscan(hit.hitpos, hit.hitSector, vect, hit, startclipmask);
auto start = hit.hitpos;
hitscan(start, hit.hitSector, vect, hit, startclipmask);
// reset hitscan block for dest sect
SetWallWarpHitscan(hit.hitSector);
@ -203,7 +204,8 @@ void FAFhitscan(const DVector3& start, sectortype* sect, const DVector3& vect, H
sectortype* newsect = nullptr;
if (Warp(hit.hitpos, &newsect))
{
hitscan(hit.hitpos, newsect, vect, hit, clipmask);
auto start = hit.hitpos;
hitscan(start, newsect, vect, hit, clipmask);
return;
}
}
@ -212,7 +214,8 @@ void FAFhitscan(const DVector3& start, sectortype* sect, const DVector3& vect, H
sectortype* newsect = nullptr;
if (WarpPlane(hit.hitpos, &newsect))
{
hitscan(hit.hitpos, newsect, vect, hit, clipmask);
auto start = hit.hitpos;
hitscan(start, newsect, vect, hit, clipmask);
return;
}
}
@ -240,7 +243,8 @@ void FAFhitscan(const DVector3& start, sectortype* sect, const DVector3& vect, H
if (plax_found)
{
hitscan(hit.hitpos, newsector, vect, hit, clipmask);
auto start = hit.hitpos;
hitscan(start, newsector, vect, hit, clipmask);
}
}