Invert check, fix xmldoc descriptions

This commit is contained in:
Kurt 2021-01-31 20:12:46 -08:00
parent 7d6249853d
commit fa3fe0a380
2 changed files with 5 additions and 5 deletions

View file

@ -73,7 +73,7 @@ namespace PKHeX.Core
{
// Can only nickname if it matches your language.
// Setting the nickname to the same as the species name does not set the Nickname flag (equals unmodified, no flag)
if (SpeciesName.IsNicknamed(pkm.Species, nickname, pkm.Language, pkm.Format))
if (!SpeciesName.IsNicknamed(pkm.Species, nickname, pkm.Language, pkm.Format))
{
data.AddLine(Get(LNickMatchLanguageFlag, Severity.Invalid));
return true;
@ -82,7 +82,7 @@ namespace PKHeX.Core
else if (pkm.Format >= 8)
{
// Having the Nickname match the species name for the pkm.Language causes it to revert to un-nicknamed.
if (SpeciesName.IsNicknamed(pkm.Species, nickname, pkm.Language, pkm.Format))
if (!SpeciesName.IsNicknamed(pkm.Species, nickname, pkm.Language, pkm.Format))
{
data.AddLine(Get(LNickMatchLanguageFlag, Severity.Invalid));
return true;

View file

@ -116,7 +116,7 @@ namespace PKHeX.Core
}
/// <summary>
/// Checks if a nickname matches the species name of any language.
/// Checks if the input <see cref="nickname"/> is not the species name for all languages.
/// </summary>
/// <param name="species">National Dex number of the Pokémon. Should be 0 if an egg.</param>
/// <param name="nickname">Current name</param>
@ -134,13 +134,13 @@ namespace PKHeX.Core
}
/// <summary>
/// Checks if a nickname matches the species name of any language.
/// Checks if the input <see cref="nickname"/> is not the species name.
/// </summary>
/// <param name="species">National Dex number of the Pokémon. Should be 0 if an egg.</param>
/// <param name="nickname">Current name</param>
/// <param name="language">Language ID of the Pokémon</param>
/// <param name="generation">Generation specific formatting option</param>
/// <returns>True if it does not match any language name, False if not nicknamed</returns>
/// <returns>True if it does not match the language name, False if not nicknamed (matches).</returns>
public static bool IsNicknamed(int species, string nickname, int language, int generation = PKX.Generation)
{
return GetSpeciesNameGeneration(species, language, generation) != nickname;