diff options
| author | Malkierian <malkierian@live.com> | 2023-03-22 17:59:08 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-22 20:59:08 -0400 |
| commit | e76b990c8a37d4877ebd4aef9ab8093450e9a0c1 (patch) | |
| tree | 969c1e2acb9c350a36c2c5d790750f1c17a2f70f /soh/src/code | |
| parent | 533ee9379addc019a1c622c6a03c6271508f81e5 (diff) | |
Randomzier: Fix starting rupee item collection (#2645)
* When rupees are given as starting items, they still modify `gSaveContext.rupeeAccumulator`, which means that if you make a new file, start it, and reload without saving, or exit SoH before starting the new file, those rupees were lost. This adds a check for `gPlayState` being NULL, and if it is, adds those initial rupees to the rupee count directly.
* Update soh/src/code/z_parameter.c
Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
---------
Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_parameter.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index c5bbb38ca..1b44f67d5 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -3084,7 +3084,11 @@ s32 Health_ChangeBy(PlayState* play, s16 healthChange) { } void Rupees_ChangeBy(s16 rupeeChange) { - gSaveContext.rupeeAccumulator += rupeeChange; + if (gPlayState == NULL) { + gSaveContext.rupees += rupeeChange; + } else { + gSaveContext.rupeeAccumulator += rupeeChange; + } if (rupeeChange > 0) { gSaveContext.sohStats.count[COUNT_RUPEES_COLLECTED] += rupeeChange; |
