From 84e69bf1e8bd0f72879efd06ce92d094a3678cb4 Mon Sep 17 00:00:00 2001 From: QuiteQuiet Date: Sat, 5 Nov 2016 01:53:06 +0100 Subject: [PATCH] Fix Pokemon name when trapped (#793) --- js/client-battle.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/client-battle.js b/js/client-battle.js index f653b24a0..3b7a49003 100644 --- a/js/client-battle.js +++ b/js/client-battle.js @@ -163,7 +163,8 @@ switch (args[0]) { case 'trapped': requestData.trapped = true; - this.battle.activityQueue.push('|message|' + pokemon.getName() + ' is trapped and cannot switch!'); + var pokeName = pokemon.side.n === 0 ? Tools.escapeHTML(pokemon.name) : "The opposing " + (this.battle.ignoreOpponent || this.battle.ignoreNicks ? pokemon.species : Tools.escapeHTML(pokemon.name)); + this.battle.activityQueue.push('|message|' + pokeName + ' is trapped and cannot switch!'); break; case 'cant': for (var i = 0; i < requestData.moves.length; i++) {