mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-12 15:15:46 +00:00
- Fixed crash calling ChangeSky() with an invalid texture.
This commit is contained in:
parent
acb4d89f52
commit
d9db8984af
2 changed files with 2 additions and 4 deletions
|
@ -80,14 +80,12 @@ void InitSkyMap(FLevelLocals *Level)
|
||||||
Level->skytexture1 = TexMan.GetFrontSkyLayer(Level->skytexture1);
|
Level->skytexture1 = TexMan.GetFrontSkyLayer(Level->skytexture1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
skytex1 = TexMan.GetGameTexture(Level->skytexture1, false);
|
skytex1 = TexMan.GetGameTexture(Level->skytexture1, false);
|
||||||
skytex2 = TexMan.GetGameTexture(Level->skytexture2, false);
|
skytex2 = TexMan.GetGameTexture(Level->skytexture2, false);
|
||||||
|
|
||||||
if (skytex1 == nullptr)
|
if (skytex1 == nullptr || skytex2 == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
if ((Level->flags & LEVEL_DOUBLESKY) && skytex1->GetDisplayHeight() != skytex2->GetDisplayHeight())
|
if ((Level->flags & LEVEL_DOUBLESKY) && skytex1->GetDisplayHeight() != skytex2->GetDisplayHeight())
|
||||||
{
|
{
|
||||||
Printf(TEXTCOLOR_BOLD "Both sky textures must be the same height." TEXTCOLOR_NORMAL "\n");
|
Printf(TEXTCOLOR_BOLD "Both sky textures must be the same height." TEXTCOLOR_NORMAL "\n");
|
||||||
|
|
|
@ -74,7 +74,7 @@ namespace swrenderer
|
||||||
auto sskytex1 = GetPalettedSWTexture(Level->skytexture1, true, false, true);
|
auto sskytex1 = GetPalettedSWTexture(Level->skytexture1, true, false, true);
|
||||||
auto sskytex2 = GetPalettedSWTexture(Level->skytexture2, true, false, true);
|
auto sskytex2 = GetPalettedSWTexture(Level->skytexture2, true, false, true);
|
||||||
|
|
||||||
if (sskytex1 == nullptr)
|
if (sskytex1 == nullptr || sskytex2 == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
skytexturemid = 0;
|
skytexturemid = 0;
|
||||||
|
|
Loading…
Reference in a new issue