mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 15:02:01 +00:00
- fixed: R_InitSkyMap must check for the null texture which cannot be used as a sky because it has no bitmap and will cause an access violation in the sky cap color calculation.
This commit is contained in:
parent
5c596d3797
commit
853e49a077
1 changed files with 11 additions and 1 deletions
|
@ -76,10 +76,20 @@ void R_InitSkyMap ()
|
||||||
int skyheight;
|
int skyheight;
|
||||||
FTexture *skytex1, *skytex2;
|
FTexture *skytex1, *skytex2;
|
||||||
|
|
||||||
|
// Do not allow the null texture which has no bitmap and will crash.
|
||||||
|
if (sky1texture.isNull())
|
||||||
|
{
|
||||||
|
sky1texture = TexMan.CheckForTexture("-noflat-", FTexture::TEX_Any);
|
||||||
|
}
|
||||||
|
if (sky2texture.isNull())
|
||||||
|
{
|
||||||
|
sky2texture = TexMan.CheckForTexture("-noflat-", FTexture::TEX_Any);
|
||||||
|
}
|
||||||
|
|
||||||
skytex1 = TexMan(sky1texture, true);
|
skytex1 = TexMan(sky1texture, true);
|
||||||
skytex2 = TexMan(sky2texture, true);
|
skytex2 = TexMan(sky2texture, true);
|
||||||
|
|
||||||
if (skytex1 == NULL)
|
if (skytex1 == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((level.flags & LEVEL_DOUBLESKY) && skytex1->GetHeight() != skytex2->GetHeight())
|
if ((level.flags & LEVEL_DOUBLESKY) && skytex1->GetHeight() != skytex2->GetHeight())
|
||||||
|
|
Loading…
Reference in a new issue