summaryrefslogtreecommitdiff
path: root/Not-showing-dex-entries-until-getting-the-Pokédex.md
blob: 40eb798194385c30a93e9c7fdc9a47fe48fd5fa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
_Credit to Jaizu_

In Generation 3, you normally can't catch Pokémon without getting the Pokédex first. Because of this, it assumes that if you catch a Pokémon, you **must** have the Pokédex, so it shows the entry.

With this change, if you catch a Pokémon without having the Pokédex, it won't show their entry. It will still register them, for when you do get the Dex.

Open [src/battle_script_commands.c](../blob/master/src/battle_script_commands.c). Find `Cmd_trysetcaughtmondexflags` and add the following `else if` in between the existing `if` and `else`:

```diff
static void Cmd_trysetcaughtmondexflags(void)
{
    u16 species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_SPECIES, NULL);
    u32 personality = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_PERSONALITY, NULL);

    if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_GET_CAUGHT))
    {
        gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
    }
+   else if (!FlagGet(FLAG_SYS_POKEDEX_GET))
+   {
+       HandleSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_SET_CAUGHT, personality);  
+       gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
+   }
    else
    {
        HandleSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_SET_CAUGHT, personality);
        gBattlescriptCurrInstr += 5;
    }
}
```