mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-25 19:57:26 -05:00
Handle level changes in detailschange (#995)
This commit is contained in:
committed by
Guangcong Luo
parent
49a6d8dcef
commit
8d21bef5ae
12
js/battle.js
12
js/battle.js
@@ -6461,11 +6461,13 @@ var Battle = (function () {
|
||||
poke.removeVolatile('typeadd');
|
||||
poke.removeVolatile('typechange');
|
||||
|
||||
var newSpecies;
|
||||
var commaIndex = args[2].indexOf(',');
|
||||
if (commaIndex === -1) {
|
||||
newSpecies = args[2];
|
||||
} else {
|
||||
var newSpecies = args[2];
|
||||
var commaIndex = newSpecies.indexOf(',');
|
||||
if (commaIndex !== -1) {
|
||||
var level = $.trim(newSpecies.substr(commaIndex + 1));
|
||||
if (level.charAt(0) === 'L') {
|
||||
poke.level = +level.substr(1);
|
||||
}
|
||||
newSpecies = args[2].substr(0, commaIndex);
|
||||
}
|
||||
var template = Tools.getTemplate(newSpecies);
|
||||
|
||||
Reference in New Issue
Block a user