mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 06:20:25 +00:00
Update WB7.cs
This commit is contained in:
parent
9f1a8d1da1
commit
5a53ae85bc
1 changed files with 8 additions and 1 deletions
|
@ -277,7 +277,14 @@ namespace PKHeX.Core
|
|||
public int GetLanguage(int redeemLanguage)
|
||||
{
|
||||
var languageOffset = GetLanguageIndex(redeemLanguage);
|
||||
return Data[0x1D8 + languageOffset];
|
||||
var value = Data[0x1D8 + languageOffset];
|
||||
if (value != 0) // Fixed receiving language
|
||||
return value;
|
||||
|
||||
// Use redeeming language (clamped to legal values for our sake)
|
||||
if (redeemLanguage is < (int)LanguageID.Japanese or (int)LanguageID.UNUSED_6 or > (int)LanguageID.ChineseT)
|
||||
return (int)LanguageID.English; // fallback
|
||||
return redeemLanguage;
|
||||
}
|
||||
|
||||
public string GetNickname(int language) => StringConverter.GetString7b(Data, GetNicknameOffset(language), 0x1A);
|
||||
|
|
Loading…
Reference in a new issue