mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-20 18:52:43 +00:00
- don't access invalid sector in DrawView.
Old bug exposed by having operator[] assert on bad access to sector[].
This commit is contained in:
parent
aee560624d
commit
7b84a1464c
1 changed files with 13 additions and 8 deletions
|
@ -251,6 +251,7 @@ void DrawView(double smoothRatio, bool sceneonly)
|
|||
|
||||
nSector = PlayerList[nLocalPlayer].nPlayerViewSect;
|
||||
updatesector(playerX, playerY, &nSector);
|
||||
if (nSector == -1) PlayerList[nLocalPlayer].nPlayerViewSect;
|
||||
|
||||
if (!SyncInput())
|
||||
{
|
||||
|
@ -305,21 +306,25 @@ void DrawView(double smoothRatio, bool sceneonly)
|
|||
}
|
||||
}
|
||||
}
|
||||
auto pSector = §or[nSector];
|
||||
nCamerax = playerX;
|
||||
nCameray = playerY;
|
||||
nCameraz = playerZ;
|
||||
|
||||
int Z = pSector->ceilingz + 256;
|
||||
if (Z <= viewz)
|
||||
if (nSector != -1)
|
||||
{
|
||||
Z = pSector->floorz - 256;
|
||||
auto pSector = §or[nSector];
|
||||
|
||||
if (Z < viewz)
|
||||
int Z = pSector->ceilingz + 256;
|
||||
if (Z <= viewz)
|
||||
{
|
||||
Z = pSector->floorz - 256;
|
||||
|
||||
if (Z < viewz)
|
||||
viewz = Z;
|
||||
}
|
||||
else {
|
||||
viewz = Z;
|
||||
}
|
||||
else {
|
||||
viewz = Z;
|
||||
}
|
||||
}
|
||||
|
||||
nCamerapan = pan;
|
||||
|
|
Loading…
Reference in a new issue