Handle level changes in detailschange (#995)

This commit is contained in:
Konrad Borowski
2017-09-03 10:47:15 +02:00
committed by Guangcong Luo
parent 49a6d8dcef
commit 8d21bef5ae

View File

@@ -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);