mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-17 06:55:05 -05:00
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>
This commit is contained in:
parent
533ee9379a
commit
e76b990c8a
@ -3084,7 +3084,11 @@ s32 Health_ChangeBy(PlayState* play, s16 healthChange) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Rupees_ChangeBy(s16 rupeeChange) {
|
void Rupees_ChangeBy(s16 rupeeChange) {
|
||||||
|
if (gPlayState == NULL) {
|
||||||
|
gSaveContext.rupees += rupeeChange;
|
||||||
|
} else {
|
||||||
gSaveContext.rupeeAccumulator += rupeeChange;
|
gSaveContext.rupeeAccumulator += rupeeChange;
|
||||||
|
}
|
||||||
|
|
||||||
if (rupeeChange > 0) {
|
if (rupeeChange > 0) {
|
||||||
gSaveContext.sohStats.count[COUNT_RUPEES_COLLECTED] += rupeeChange;
|
gSaveContext.sohStats.count[COUNT_RUPEES_COLLECTED] += rupeeChange;
|
||||||
|
Loading…
Reference in New Issue
Block a user