mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-09 13:55:22 -05:00
Simplify isnicknamedany
for gen2 korean edge case (use lang 8), and skip lang 0 (same as lang 1)
This commit is contained in:
@@ -236,16 +236,15 @@ public static string GetSpeciesNameGeneration(int species, int lang, int generat
|
||||
/// <returns>True if it does not match any language name, False if not nicknamed</returns>
|
||||
public static bool IsNicknamedAnyLanguage(int species, string nick, int generation)
|
||||
{
|
||||
int len = SpeciesLang.Length;
|
||||
IEnumerable<int> len;
|
||||
if (generation < 3)
|
||||
len = 3;
|
||||
len = new[] {1,2,8}; // check Korean for the VC case, never possible to match string outside of this case
|
||||
else if (generation < 7)
|
||||
len = 9; // chinese (CHS/CHT) introduced in Gen7
|
||||
len = Enumerable.Range(1, 9 - 1); // chinese (CHS/CHT) introduced in Gen7
|
||||
else
|
||||
len = Enumerable.Range(1, SpeciesLang.Length - 1);
|
||||
|
||||
for (int i = 0; i < len; i++)
|
||||
if (GetSpeciesNameGeneration(species, i, generation) == nick)
|
||||
return false;
|
||||
return true;
|
||||
return len.All(lang => GetSpeciesNameGeneration(species, lang, generation) != nick);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user