From 10912eba244ec4f4ec608af2b9cc716aa0f1ce3b Mon Sep 17 00:00:00 2001 From: Mia <49593536+mia-pi-git@users.noreply.github.com> Date: Fri, 8 Aug 2025 21:57:46 -0500 Subject: [PATCH] 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. --- play.pokemonshowdown.com/js/storage.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/play.pokemonshowdown.com/js/storage.js b/play.pokemonshowdown.com/js/storage.js index 555e2c1f6..cf1c0f27b 100644 --- a/play.pokemonshowdown.com/js/storage.js +++ b/play.pokemonshowdown.com/js/storage.js @@ -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