Merge pull request #1836 from GriffinRichards/fix-clone

Add fix for Battle Tower cloning bug
This commit is contained in:
GriffinR 2023-01-15 00:32:24 -05:00 committed by GitHub
commit c663154760
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -411,7 +411,13 @@ BattleFrontier_BattleTowerLobby_EventScript_SaveBeforeLinkMultisChallenge::
special LoadPlayerParty
closemessage
delay 2
@ The command tower_save ultimately calls TrySavingData(SAVE_LINK), which writes data in SaveBlock1 and SaveBlock2
@ to the flash, but not data in PokemonStorage. The SaveGame script that follows asks the player to do a full save,
@ which they can opt out of. As a result the player can save their party and quit without having saved the PC.
@ This allows players to clone pokemon and their held items by withdrawing them (or erase them by despositing).
.ifndef BUGFIX
tower_save 0
.endif
call Common_EventScript_SaveGame
setvar VAR_TEMP_0, 255
goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_CancelChallengeSaveFailed