summaryrefslogtreecommitdiff
path: root/src/save.c
diff options
context:
space:
mode:
authorSlawter666 <38655737+Slawter666@users.noreply.github.com>2018-11-12 14:14:50 +0000
committerSlawter666 <38655737+Slawter666@users.noreply.github.com>2018-11-12 14:14:50 +0000
commit1b895ff52c011d51a9516791148cd5088ba411b5 (patch)
tree3f1dee86f96098d38131426e11a0f9c39a1244fe /src/save.c
parentbe33878b94cc38913447682d3e34e674df68619f (diff)
parent65f053fd89e09b13e407ac53488043b728660e6e (diff)
Merge branch 'master' of https://github.com/pret/pokeemerald into synchronise
Diffstat (limited to 'src/save.c')
-rw-r--r--src/save.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/save.c b/src/save.c
index 68427c4c3..0bd48cca9 100644
--- a/src/save.c
+++ b/src/save.c
@@ -712,30 +712,34 @@ u8 HandleSavingData(u8 saveType)
u8 TrySavingData(u8 saveType) // TrySave
{
- if(gFlashMemoryPresent == TRUE)
+ if (gFlashMemoryPresent != TRUE)
{
- HandleSavingData(saveType);
- if(gDamagedSaveSectors)
- DoSaveFailedScreen(saveType);
- else
- goto OK; // really?
+ gUnknown_03006294 = 0xFF;
+ return 0xFF;
}
- gUnknown_03006294 = 0xFF;
- return 0xFF;
-OK:
- gUnknown_03006294 = 1;
- return 1;
+ HandleSavingData(saveType);
+ if (!gDamagedSaveSectors)
+ {
+ gUnknown_03006294 = 1;
+ return 1;
+ }
+ else
+ {
+ DoSaveFailedScreen(saveType);
+ gUnknown_03006294 = 0xFF;
+ return 0xFF;
+ }
}
-u8 sub_8153380(void) // trade.s save
+bool8 sub_8153380(void) // trade.s save
{
if (gFlashMemoryPresent != TRUE)
- return 1;
+ return TRUE;
UpdateSaveAddresses();
SaveSerializedGame();
RestoreSaveBackupVarsAndIncrement(gRamSaveSectionLocations);
- return 0;
+ return FALSE;
}
bool8 sub_81533AC(void) // trade.s save
@@ -744,9 +748,9 @@ bool8 sub_81533AC(void) // trade.s save
if (gDamagedSaveSectors)
DoSaveFailedScreen(0);
if (retVal == 0xFF)
- return 1;
+ return TRUE;
else
- return 0;
+ return FALSE;
}
u8 sub_81533E0(void) // trade.s save