Resolve RetrieveBreedmon
reading garbage data for wCurForm
#783
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
RetrieveBreedmon
reads in old/garbage data forwCurForm
. This is caused by reading the "LastPartyMon"'s Form byte BEFORE we had a chance to copy theBREEDMON_STRUCT
to the "LastPartyMon" slot.Having garbage data in
wCurForm
causesGetBaseData
to produce garbage data, thus causing the occasional breedmon Div by 0 error inCalcExpAtLevel:
. I predict it is also highly likely that his problem causes the other bug reports where occasionally a mon instantly jumps to level 100 from the daycare.Please see below for bug reports.
https://discord.com/channels/332698009060114434/933019563535253534/1061069088123793499
https://discord.com/channels/332698009060114434/332698384987193354/1067665669753151518
https://discord.com/channels/332698009060114434/332698384987193354/1067802347851485215
If you would like to do some testing with this yourself. I have a save file I can send with steps to reproduce the div by 0 error. Just send me a message and i'll give you relevant file/info.
Resolves #784, Resolves #657