ref: c8e9a82190fcb8687e3e48c1268f4b888e536f57
parent: a6ac67dea2ea7a1a35fce63a8bd10deb7147c3ed
author: mid-kid <[email protected]>
date: Thu Mar 30 01:15:35 EDT 2023
Make wMysteryGift*GameVersion constants consistent
--- a/engine/link/mystery_gift.asm
+++ b/engine/link/mystery_gift.asm
@@ -76,7 +76,7 @@
jp z, .LinkCanceled
cp MG_OKAY
jp nz, .CommunicationError
- ld a, [wMysteryGiftGameVersion]
+ ld a, [wMysteryGiftPartnerGameVersion]
cp POKEMON_PIKACHU_2_VERSION
jr z, .skip_checks
call .CheckAlreadyGotFiveGiftsToday
@@ -92,11 +92,11 @@
ld a, [wMysteryGiftPartnerBackupItem]
and a
jp nz, .FriendNotReady
- ld a, [wMysteryGiftGameVersion]
+ ld a, [wMysteryGiftPartnerGameVersion]
cp POKEMON_PIKACHU_2_VERSION
jr z, .skip_append_save
call .AddMysteryGiftPartnerID
- ld a, [wMysteryGiftGameVersion]
+ ld a, [wMysteryGiftPartnerGameVersion]
cp RESERVED_GAME_VERSION
jr z, .skip_append_save
call .SaveMysteryGiftTrainerName
@@ -307,7 +307,7 @@
ldh a, [hMGRole]
cp IR_SENDER
jr z, SenderExchangeMysteryGiftDataPayloads
-; receiver
+
ld hl, hMGExchangedByte
ld b, 1
call TryReceivingIRDataBlock
@@ -522,7 +522,7 @@
ldh a, [hMGRole]
cp IR_SENDER
jr z, .sender
-; receiver
+
call BeginReceivingIRCommunication
jr nz, EndOrContinueMysteryGiftIRCommunication
jp ReceiverExchangeMysteryGiftDataPayloads
@@ -563,7 +563,7 @@
ldh a, [hMGRole]
cp IR_SENDER
jr z, .sender
-; receiver
+
; Receive the data payload
call ReceiveNameCardDataPayload
jp nz, EndNameCardIRCommunication
--- a/ram/wram.asm
+++ b/ram/wram.asm
@@ -1073,7 +1073,7 @@
ds 138
wMysteryGiftPartnerData::
-wMysteryGiftGameVersion:: db
+wMysteryGiftPartnerGameVersion:: db
wMysteryGiftPartnerID:: dw
wMysteryGiftPartnerName:: ds NAME_LENGTH
wMysteryGiftPartnerDexCaught:: db
@@ -1087,7 +1087,7 @@
ds 60
wMysteryGiftPlayerData::
- ds 1
+wMysteryGiftPlayerGameVersion:: db
wMysteryGiftPlayerID:: dw
wMysteryGiftPlayerName:: ds NAME_LENGTH
wMysteryGiftPlayerDexCaught:: db