From 91a4e6aed48b299379e4ff5651e1849b6b8b542e Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sat, 5 Sep 2020 06:18:41 -0400 Subject: [PATCH] - do unity data status bar correction only if stbar is in an iwad --- src/d_main.cpp | 13 +++++++++++++ wadsrc_extra/static/iwadinfo.txt | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 6615ccadc..600a69c65 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -2967,8 +2967,21 @@ static void FixUnityStatusBar() if (gameinfo.flags & GI_ALWAYSCENTERSBAR) { FGameTexture* sbartex = TexMan.FindGameTexture("stbar", ETextureType::MiscPatch); + + // texture not found, we're not here to operate on a non-existent texture so just exit if (!sbartex) return; + + // where is this texture located? if it's not in an iwad, then exit + int lumpnum = sbartex->GetSourceLump(); + if (lumpnum >= 0 && lumpnum < fileSystem.GetNumEntries()) + { + int wadno = fileSystem.GetFileContainer(lumpnum); + if (!(wadno >= fileSystem.GetIwadNum() && wadno <= fileSystem.GetMaxIwadNum())) + return; + } + + // only adjust offsets if none already exist if (sbartex->GetTexelWidth() > 320 && !sbartex->GetTexelLeftOffset(0) && !sbartex->GetTexelTopOffset(0)) { diff --git a/wadsrc_extra/static/iwadinfo.txt b/wadsrc_extra/static/iwadinfo.txt index 52d6f699a..eb15ea729 100644 --- a/wadsrc_extra/static/iwadinfo.txt +++ b/wadsrc_extra/static/iwadinfo.txt @@ -348,6 +348,7 @@ IWad "E3M1","E3M2","E3M3","E3M4","E3M5","E3M6","E3M7","E3M8","E3M9", "DPHOOF","BFGGA0","HEADA1","CYBRA1","SPIDA1D1", "E4M2", "DMENUPIC" + Load = "extras.wad", "soundtrack" BannerColors = "00 7c 00", "a8 a8 a8" IgnoreTitlePatches = 1 AlwaysCenterStatusbar = 1 @@ -512,7 +513,7 @@ IWad MustContain = "MAP01", "DMENUPIC" BannerColors = "00 7c 00", "a8 a8 a8" IgnoreTitlePatches = 1 - Load = "nerveunity.wad" + Load = "nerveunity.wad", "extras.wad", "soundtrack" AlwaysCenterStatusbar = 1 }