mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-21 19:51:03 +00:00
Fix crash when clipping through into non-sector areas
This commit is contained in:
parent
92bdafc4ba
commit
93eabd1b4f
1 changed files with 8 additions and 3 deletions
|
@ -176,10 +176,15 @@ void RenderViewpoint(FRenderViewpoint& mainvp, IntRect* bounds, float fov, float
|
|||
// Stereo mode specific viewpoint adjustment
|
||||
if (eye.mShiftFactor != 0)
|
||||
{
|
||||
vp.Pos += eye.GetViewShift(vp.HWAngles);
|
||||
DVector3 newpos = vp.Pos;
|
||||
newpos += eye.GetViewShift(vp.HWAngles);
|
||||
sectortype* sect = §or[vp.SectCount];
|
||||
updatesector(DVector2(vp.Pos.X, -vp.Pos.Y), §);
|
||||
vp.SectCount = sectindex(sect);
|
||||
updatesector(DVector2(newpos.X, -newpos.Y), §);
|
||||
if (sect != nullptr)
|
||||
{
|
||||
vp.Pos = newpos;
|
||||
vp.SectCount = sectindex(sect);
|
||||
}
|
||||
}
|
||||
|
||||
di->SetupView(RenderState, vp.Pos.X, vp.Pos.Y, vp.Pos.Z, false, false);
|
||||
|
|
Loading…
Reference in a new issue