incremement dexnav chain fix

This commit is contained in:
ghoulslash 2021-05-18 09:31:53 -06:00
parent 3c4bf808f1
commit abe68b7466
3 changed files with 13 additions and 1 deletions

View file

@ -127,6 +127,7 @@ void TryIncrementSpeciesSearchLevel(u16 dexNum);
void ResetDexNavSearch(void); void ResetDexNavSearch(void);
bool8 TryFindHiddenPokemon(void); bool8 TryFindHiddenPokemon(void);
bool8 DexNavTryMakeShinyMon(void); bool8 DexNavTryMakeShinyMon(void);
void IncrementDexNavChain(void);
//ewram //ewram
extern u8 gCurrentDexNavChain; extern u8 gCurrentDexNavChain;

View file

@ -5072,6 +5072,11 @@ static void FreeResetData_ReturnToOvOrDoEvolutions(void)
{ {
if (!gPaletteFade.active) if (!gPaletteFade.active)
{ {
if (gDexnavBattle && (gBattleOutcome == B_OUTCOME_WON || gBattleOutcome == B_OUTCOME_CAUGHT))
IncrementDexNavChain();
else
gSaveBlock1Ptr->dexNavChain = 0;
ResetSpriteData(); ResetSpriteData();
if (gLeveledUpInBattle == 0 || gBattleOutcome != B_OUTCOME_WON) if (gLeveledUpInBattle == 0 || gBattleOutcome != B_OUTCOME_WON)
{ {

View file

@ -2720,4 +2720,10 @@ void ResetDexNavSearch(void)
VarSet(VAR_DEXNAV_STEP_COUNTER, 0); //reset hidden pokemon step counter VarSet(VAR_DEXNAV_STEP_COUNTER, 0); //reset hidden pokemon step counter
if (FlagGet(FLAG_SYS_DEXNAV_SEARCH)) if (FlagGet(FLAG_SYS_DEXNAV_SEARCH))
EndDexNavSearch(FindTaskIdByFunc(Task_DexNavSearch)); //moving to new map ends dexnav search EndDexNavSearch(FindTaskIdByFunc(Task_DexNavSearch)); //moving to new map ends dexnav search
} }
void IncrementDexNavChain(void)
{
if (gSaveBlock1Ptr->dexNavChain < DEXNAV_CHAIN_MAX)
gSaveBlock1Ptr->dexNavChain++;
}