GLDEFS "thiswad" handler broken

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

GLDEFS "thiswad" handler broken

Postby Gez » Thu Jul 01, 2021 1:51 pm

Brightmap definitions with the "thiswad" keyword do not work. From best I can tell, this seems due to what looks like a mistake here:

Code: Select allExpand view
      if (thiswad || iwad)
      {
         bool useme = false;
         int lumpnum = tex->GetSourceLump();

         if (lumpnum != -1)
         {
            if (iwad && fileSystem.GetFileContainer(lumpnum) <= fileSystem.GetMaxIwadNum()) useme = true;
            if (thiswad && fileSystem.GetFileContainer(lumpnum) == workingLump) useme = true;
         }
         if (!useme) return;
      }

You'll notice it's apparently trying to compare a file with a lump. I suppose it should be
Code: Select allExpand view
            if (thiswad && fileSystem.GetFileContainer(lumpnum) == fileSystem.GetFileContainer(workingLump)) useme = true;
Gez
 
 
 
Joined: 06 Jul 2007

Re: GLDEFS "thiswad" handler broken

Postby Warden » Fri Jul 02, 2021 7:19 am

Would love to see this fixed for the sake of autoloading brightmaps in combination with sprite fixes.
Warden
 
Joined: 24 May 2020

Re: GLDEFS "thiswad" handler broken

Postby drfrag » Fri Jul 16, 2021 2:09 pm

But the same comparison is also present in void ParseMaterial() not only in void ParseBrightmap().
The code in the legacy build is pretty much the same:
Code: Select allExpand view
      if (thiswad || iwad)
      {
         bool useme = false;
         int lumpnum = tex->GetSourceLump();

         if (lumpnum != -1)
         {
            if (iwad && Wads.GetLumpFile(lumpnum) <= Wads.GetIwadNum()) useme = true;
            if (thiswad && Wads.GetLumpFile(lumpnum) == workingLump) useme = true;
         }
         if (!useme) return;
      }

Since when does this happen?
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: GLDEFS "thiswad" handler broken

Postby Gez » Sat Jul 17, 2021 12:28 am

I dunno, but it didn't work.
viewtopic.php?f=122&t=72675
Gez
 
 
 
Joined: 06 Jul 2007

Re: GLDEFS "thiswad" handler broken

Postby drfrag » Sat Jul 17, 2021 2:26 am

Okay but how can i test this? You said it worked in an older version but which one? That code is very old and the functions are equivalent (minus the materials part).
I guess the other check in ParseMaterial needs to be replaced too becouse it's the same.
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: GLDEFS "thiswad" handler broken

Postby drfrag » Sat Jul 17, 2021 4:22 am

I've tested REKKR and now it works. The check for materials is still wrong upstream.
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666


Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests