Updated OW_SYNCHRONIZE_NATURE statement in ScriptGiveMonParameterized (#4271)
Fixes an issue where the nature of a Deoxys would be randomized even if one was set at the time of calling givemon or the functions related to it.
This commit is contained in:
parent
6804e82c0a
commit
15aa909944
1 changed files with 8 additions and 4 deletions
|
@ -299,10 +299,14 @@ u32 ScriptGiveMonParameterized(u16 species, u8 level, u16 item, u8 ball, u8 natu
|
||||||
u16 targetSpecies;
|
u16 targetSpecies;
|
||||||
|
|
||||||
// check whether to use a specific nature or a random one
|
// check whether to use a specific nature or a random one
|
||||||
if (OW_SYNCHRONIZE_NATURE >= GEN_6 && (gSpeciesInfo[species].eggGroups[0] == EGG_GROUP_NO_EGGS_DISCOVERED || OW_SYNCHRONIZE_NATURE == GEN_7))
|
if (nature >= NUM_NATURES)
|
||||||
|
{
|
||||||
|
if (OW_SYNCHRONIZE_NATURE >= GEN_6
|
||||||
|
&& (gSpeciesInfo[species].eggGroups[0] == EGG_GROUP_NO_EGGS_DISCOVERED || OW_SYNCHRONIZE_NATURE == GEN_7))
|
||||||
nature = PickWildMonNature();
|
nature = PickWildMonNature();
|
||||||
else if (nature >= NUM_NATURES)
|
else
|
||||||
nature = Random() % NUM_NATURES;
|
nature = Random() % NUM_NATURES;
|
||||||
|
}
|
||||||
|
|
||||||
// create a Pokémon with basic data
|
// create a Pokémon with basic data
|
||||||
if ((gender == MON_MALE && genderRatio != MON_FEMALE && genderRatio != MON_GENDERLESS)
|
if ((gender == MON_MALE && genderRatio != MON_FEMALE && genderRatio != MON_GENDERLESS)
|
||||||
|
|
Loading…
Reference in a new issue