Skip to content

Commit

Permalink
GBA Savedata: Fix sanity check in Load
Browse files Browse the repository at this point in the history
  • Loading branch information
endrift committed Mar 2, 2023
1 parent ee21eed commit 2cce155
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gba/savedata.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ size_t GBASavedataSize(const struct GBASavedata* savedata) {

bool GBASavedataLoad(struct GBASavedata* savedata, struct VFile* in) {
if (savedata->data) {
if (!in && savedata->type != SAVEDATA_FORCE_NONE) {
if (!in || savedata->type != SAVEDATA_FORCE_NONE) {

This comment has been minimized.

Copy link
@AdmiralCurtiss

AdmiralCurtiss Mar 5, 2023

Shouldn't this be !in || savedata->type == SAVEDATA_FORCE_NONE? Or am I misunderstanding how the function is supposed to be used?

This comment has been minimized.

Copy link
@AdmiralCurtiss

AdmiralCurtiss Mar 5, 2023

(I just updated the mGBA submodule on Dolphin and testing around the load-save-file option is no longer working like I'm expecting it to, and I think this check here is why.)

This comment has been minimized.

Copy link
@endrift

endrift Mar 5, 2023

Author Member

yes, you're correct, thanks for noticing.

return false;
}
ssize_t size = GBASavedataSize(savedata);
Expand Down

0 comments on commit 2cce155

Please sign in to comment.