summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGriffinR <griffin.richards@comcast.net>2019-11-23 10:11:05 -0500
committerGriffinR <griffin.richards@comcast.net>2019-11-23 10:11:05 -0500
commitf039e897ca8229e6e9b104408bf48c2d4e0dcb4b (patch)
tree1581acd8b6a5bae8fbd923492f2e301c8b6abe91 /src
parent2bf1e0600ee341970c4731640a351ded047a55c5 (diff)
Use APPRENTICE_COUNT for record_mixing mod
Diffstat (limited to 'src')
-rw-r--r--src/record_mixing.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/record_mixing.c b/src/record_mixing.c
index 0a3b22a28..4ad47cc21 100644
--- a/src/record_mixing.c
+++ b/src/record_mixing.c
@@ -1035,7 +1035,7 @@ static void GetSavedApprentices(struct Apprentice *dst, struct Apprentice *src)
numMixApprentices = 0;
for (i = 0; i < 2; i++)
{
- id = ((i + gSaveBlock2Ptr->playerApprentice.saveId) % 3) + 1;
+ id = ((i + gSaveBlock2Ptr->playerApprentice.saveId) % (APPRENTICE_COUNT - 1)) + 1;
if (src[id].playerName[0] != EOS)
{
if (GetTrainerId(src[id].playerId) != GetTrainerId(gSaveBlock2Ptr->playerTrainerId))
@@ -1070,7 +1070,7 @@ static void GetSavedApprentices(struct Apprentice *dst, struct Apprentice *src)
}
else
{
- dst[1] = src[((gSaveBlock2Ptr->playerApprentice.saveId + 1) % 3 + 1)];
+ dst[1] = src[((gSaveBlock2Ptr->playerApprentice.saveId + 1) % (APPRENTICE_COUNT - 1) + 1)];
}
break;
}
@@ -1156,15 +1156,15 @@ static void ReceiveApprenticeData(struct Apprentice *mixApprentice, size_t recor
case 1:
apprenticeSaveId = gSaveBlock2Ptr->playerApprentice.saveId + 1;
gSaveBlock2Ptr->apprentices[apprenticeSaveId] = mixApprenticePtr[apprenticeId];
- gSaveBlock2Ptr->playerApprentice.saveId = (gSaveBlock2Ptr->playerApprentice.saveId + 1) % 3;
+ gSaveBlock2Ptr->playerApprentice.saveId = (gSaveBlock2Ptr->playerApprentice.saveId + 1) % (APPRENTICE_COUNT - 1);
break;
case 2:
for (i = 0; i < 2; i++)
{
- apprenticeSaveId = ((i ^ 1) + gSaveBlock2Ptr->playerApprentice.saveId) % 3 + 1;
+ apprenticeSaveId = ((i ^ 1) + gSaveBlock2Ptr->playerApprentice.saveId) % (APPRENTICE_COUNT - 1) + 1;
gSaveBlock2Ptr->apprentices[apprenticeSaveId] = mixApprenticePtr[i];
}
- gSaveBlock2Ptr->playerApprentice.saveId = (gSaveBlock2Ptr->playerApprentice.saveId + 2) % 3;
+ gSaveBlock2Ptr->playerApprentice.saveId = (gSaveBlock2Ptr->playerApprentice.saveId + 2) % (APPRENTICE_COUNT - 1);
break;
}
}