Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evaluate numiwadlumps after DoMerge() has been called #1630

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

fabiangreffrath
Copy link
Member

If a merged PWAD contains sprites, these get mangled into the IWAD sprites, changing the value of numlumps and thus invalidating the value of numiwadlumps determined earlier. Also, this variable is only used in one occasion, so only evaluate it as needed.

This approach makes sure numiwadlumps points past the index of the last IWAD lump in the linear lumpinfo[] array.

Fixes fabiangreffrath#1101

If a merged PWAD contains sprites, these get mangled into the IWAD
sprites, changing the value of `numlumps` and thus invalidating the
value of `numiwadlumps` determined earlier. Also, this variable is
only used in one occasion, so only evaluate it as needed.

This approach makes sure `numiwadlumps` points past the index of the
last IWAD lump in the linear `lumpinfo[]` array.

Fixes fabiangreffrath#1101

while (!W_IsIWADLump(lumpinfo[numiwadlumps - 1]))
{
numiwadlumps--;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What prevents this going negative?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that we have an IWAD with at least one lump loaded at this point

@turol
Copy link
Member

turol commented Oct 20, 2023

Fix capitalization in commit message.

@fabiangreffrath
Copy link
Member Author

Fix capitalization in commit message.

Are you joking?!

@turol
Copy link
Member

turol commented Oct 20, 2023

Let's try to keep the history looking nice.

@fabiangreffrath fabiangreffrath merged commit 7d44fa1 into master Oct 20, 2023
6 checks passed
@fabiangreffrath fabiangreffrath deleted the numiwadlumps branch October 20, 2023 10:42
@fragglet
Copy link
Member

Fix capitalization in commit message.

I'm all in favour of keeping a good revision history but it's possible to get excessively nitpicky with reviews and I think this is one example. Let's keep in mind that review comments do place a burden onto the author of the PR (no matter how small) and in cases like these it's probably best to just let it go.

The Google Testing blog has an article about effective reviews which recommends flagging comments like these with "Nit:" to make clear that they're optional suggestions.

@turol
Copy link
Member

turol commented Jan 23, 2024

Do you want to write something about this change for NEWS.md in #1623?

@fabiangreffrath
Copy link
Member Author

I don't think so, this was merely a bug fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

numiwadlumps needs re-evaluation, else embedded DEHACKED lumps are skipped
3 participants