diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2019-09-04 15:42:53 -0400 |
---|---|---|
committer | huderlem <huderlem@gmail.com> | 2019-09-05 20:48:48 -0500 |
commit | e87f4f4cc7fb872507db4fb1c48afb7d8e3f2d79 (patch) | |
tree | 8072859da7b7fcaa0fdf9a1bc1c373491893e372 /src/ereader_helpers.c | |
parent | 904bba9e16f99bc7a306b6705948cbfe14e41786 (diff) |
Unify TrHillTag struct definitions (variable floors)
Diffstat (limited to 'src/ereader_helpers.c')
-rwxr-xr-x | src/ereader_helpers.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ereader_helpers.c b/src/ereader_helpers.c index f680e32e0..f184dea82 100755 --- a/src/ereader_helpers.c +++ b/src/ereader_helpers.c @@ -450,14 +450,14 @@ static bool32 TryWriteTrainerHill_r(struct EReaderTrainerHillSet *ttdata, struct memset(buffer2, 0, 0x1000); buffer2->unkField_0 = ttdata->count; buffer2->unused1 = sub_81D38D4(); - buffer2->unkField_2 = (ttdata->count + 1) / 2; + buffer2->numFloors = (ttdata->count + 1) / 2; for (i = 0; i < ttdata->count; i++) { if (!(i & 1)) { buffer2->floors[i / 2].unk0 = ttdata->unk_8[i].unk0; - memcpy(buffer2->floors[i / 2].data, ttdata->unk_8[i].unk14C, 0x124); + buffer2->floors[i / 2].display = ttdata->unk_8[i].unk14C; buffer2->floors[i / 2].trainers[0] = ttdata->unk_8[i].unk4; } else @@ -472,7 +472,7 @@ static bool32 TryWriteTrainerHill_r(struct EReaderTrainerHillSet *ttdata, struct buffer2->floors[i / 2].trainers[1] = sTrainerHillTrainerTemplates_JP[i / 2]; } - buffer2->checksum = CalcByteArraySum((u8 *)buffer2->floors, sizeof(buffer2->floors)); + buffer2->checksum = CalcByteArraySum((u8 *)buffer2->floors, 4 * sizeof(struct TrHillFloor)); if (TryWriteSpecialSaveSection(SECTOR_ID_TRAINER_HILL, (u8 *)buffer2) != 1) return FALSE; |