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

Fix auto save state when state file does not already exist #16084

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

danielbyon
Copy link
Contributor

Description

Context

The PR that went in last week to fix auto save states for Netplay broke saving the auto state when the file did not already exist. This is because the (new) auto save state function differs slightly with the (regular) save state function. The regular function checks if the path is valid, but only to load the existing save state into memory for undo purposes. Since we call the auto save state function from either core unload or quit, we shouldn't need to care about the undo stack.

The auto function currently only works if the state exists (since path would be "valid"), so if the auto state file does not already exist on disk, then it will fail the path_is_valid() check and not create a new file.

Fix

The fix here is to simply remove the path_is_valid() check. Since the regular function only checked if a file already exists for purposes of undo, the auto function can simply always (attempt to) write the state data.

Related Issues

#16080

Related Pull Requests

#16061

Reviewers

[If possible @mention all the people that should review your pull request]

@davidgfnet
Copy link
Contributor

Oops! Sorry for that! We did test this (at least a couple humans) and we missed that!
The fix looks good to me. I assume you also tested it right?
Thanks!

@danielbyon
Copy link
Contributor Author

Yea I tested for just auto save, didn't test Netplay (because I've never used it 😅)

@davidgfnet
Copy link
Contributor

Yeah that's totally fine :D

@danielbyon
Copy link
Contributor Author

Who has merge privileges? Can we get this merged for tonight's build?

@LibretroAdmin LibretroAdmin merged commit fc10539 into libretro:master Jan 8, 2024
23 checks passed
@danielbyon danielbyon deleted the fix_autosave branch October 15, 2024 21:05
Sunderland93 pushed a commit to Sunderland93/RetroArch that referenced this pull request Dec 26, 2024
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.

3 participants