summaryrefslogtreecommitdiff
path: root/src/trainer_tower.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/trainer_tower.c')
-rw-r--r--src/trainer_tower.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/trainer_tower.c b/src/trainer_tower.c
index fd10e33b2..cda4a3a74 100644
--- a/src/trainer_tower.c
+++ b/src/trainer_tower.c
@@ -501,7 +501,7 @@ void GetTrainerTowerOpponentLoseText(u8 *dest, u8 opponentIdx)
TT_ConvertEasyChatMessageToString(sTrainerTowerOpponent->speechLose2, dest);
}
-static void SetUpTrainerTowerDataStruct(void) // fakematching
+static void SetUpTrainerTowerDataStruct(void)
{
u32 challengeType = gSaveBlock1Ptr->towerChallengeId;
s32 r4;
@@ -519,16 +519,7 @@ static void SetUpTrainerTowerDataStruct(void) // fakematching
r7 = gUnknown_84827B4[challengeType];
for (r4 = 0; r4 < MAX_TRAINER_TOWER_FLOORS; r4++)
{
- #ifndef NONMATCHING
- void * r5;
- register void * r0 asm("r0") = sTrainerTowerState;
- r5 = (void *)(r4 * sizeof(struct TrainerTowerFloor));
- r0 = r5 + (uintptr_t)r0;
- r0 += offsetof(struct UnkStruct_203F458, unk_0004.floors);
- memcpy(r0, r7[r4], sizeof(struct TrainerTowerFloor));
- #else
- memcpy(&sTrainerTowerState->unk_0004.floors[r4], r7[r4], sizeof(struct TrainerTowerFloor));
- #endif
+ *(sTrainerTowerState->unk_0004.floors + r4) = *(r7[r4]); // manual pointer arithmetic needed to match
}
sTrainerTowerState->unk_0004.checksum = CalcByteArraySum((void *)sTrainerTowerState->unk_0004.floors, sizeof(sTrainerTowerState->unk_0004.floors));
ValidateOrResetCurTrainerTowerRecord();