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

2024 Matsuribayashi Ch.8 Crash Fixes #120

Merged
merged 2 commits into from
Feb 24, 2024
Merged

2024 Matsuribayashi Ch.8 Crash Fixes #120

merged 2 commits into from
Feb 24, 2024

Conversation

drojf
Copy link
Contributor

@drojf drojf commented Jan 22, 2024

Change Description

Doddler pushed some fixes to Ch.8 to prevent crashing to the unmodded game on 2024-01-01. From Doddler's twitter:

Doh, someone reported a game crash on higurashi chapter 8 and it turns out the game gets caught in an infinite loop if you save and load your game within the first 5 or so minutes.

Was a fun one, if you're interested in the tech details: layers with a priority above 32 don't get removed at scene transitions. Usually layers have the same id as their priority, but that's not true in the opening. Loading a saved game incorrectly resets priority to the layer #.

This causes the vignette border in the OP (layer 1 priority 35) to get incorrectly deleted, but a fade command still targets the inactive layer. Later it tries to load the layer using a loop that gets the layer and resets it if it's fading, but this fails because it's not active.

The reason it's looping was for safety, if a layer somehow ended up back in the layer pool but still alive, like with our load bug, we would simply reset it, put it back, and then try again. But the reset returns early if it has no texture, which causes the fade to not clear.

This PR contains those changes (manually applied due to differences between our mod branch and Ch.8).

I'm still on the fence on applying it for previous chapters in case it somehow breaks something, as the crashes were mainly on Ch.8 (and maybe Ch.7? not sure).

Changes made

Apply unmodded fixes for Ch.8 crashing
- This applies the changes from the unmodded game made on 2024-01-01
- Bump save file version to 2. Old saves can still be loaded (version check when loading saves was removed)
- Save layer priority in save file
- Prevent infinite loop waiting for layer to fade out
- Check whether layer is not in use before using it in certain fns
- Some changes to FadeTo() and ReleaseTextures() functions

drojf added 2 commits January 13, 2024 12:23
 - This applies the changes from the unmodded  game made on 2024-01-01
 - Bump save file version to 2. Old saves can still be loaded (version check when loading saves was removed)
 - Save layer priority in save file
 - Prevent infinite loop waiting for layer to fade out
 - Check whether layer is not in use before using it in certain fns
 - Some changes to FadeTo() and ReleaseTextures() functions
@drojf drojf changed the title 2024 Matsuri Crash Fixes 2024 Matsuribayashi Ch.8 Crash Fixes Jan 22, 2024
@drojf drojf merged commit ea2207d into mod Feb 24, 2024
2 checks passed
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.

1 participant