Storage: Unpack team natures properly

This object is specifically indexed by name instead of ID - remote teams are sometimes lowercase. To be most comprehensive, we handle this at team unpack rather than whack-a-moling callsites.
This commit is contained in:
Mia 2025-08-08 21:57:46 -05:00
parent a24ddeb4fa
commit 10912eba24

View File

@ -920,6 +920,11 @@ Storage.fastUnpackTeam = function (buf) {
j = buf.indexOf('|', i);
set.nature = buf.substring(i, j);
if (set.nature === 'undefined') set.nature = undefined;
if (set.nature) {
// BattleNatures is case sensitive, so if we don't do this
// sometimes stuff breaks. goody.
set.nature = set.nature.charAt(0).toUpperCase() + set.nature.slice(1);
}
i = j + 1;
// evs
@ -1038,6 +1043,11 @@ Storage.unpackTeam = function (buf) {
j = buf.indexOf('|', i);
set.nature = buf.substring(i, j);
if (set.nature === 'undefined') set.nature = undefined;
if (set.nature) {
// BattleNatures is case sensitive, so if we don't do this
// sometimes stuff breaks. goody.
set.nature = set.nature.charAt(0).toUpperCase() + set.nature.slice(1);
}
i = j + 1;
// evs