mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-03-21 17:50:29 -05:00
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:
parent
a24ddeb4fa
commit
10912eba24
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user