From 5c9c007d4a80a68ddc2a94ba0d59de9977522a6e Mon Sep 17 00:00:00 2001 From: Gnieark Date: Fri, 18 Dec 2015 21:28:38 +0100 Subject: [PATCH] strikes --- src/arenas/Battleship/js.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/arenas/Battleship/js.js b/src/arenas/Battleship/js.js index 759bbfa..f68366c 100644 --- a/src/arenas/Battleship/js.js +++ b/src/arenas/Battleship/js.js @@ -29,9 +29,10 @@ function fight(xd_check){ document.getElementById('logs').innerHTML = 'erreur' +xhr.responseText; return; } - var coords = strike['target'].split(","); - document.getElementById( 'bot' + strike['opponent'] + '-' + coords[1] + '-' + coords[0]).innerHTML = "X"; - + if( strike['target'] <> ''){ + var coords = strike['target'].split(","); + document.getElementById( 'bot' + strike['opponent'] + '-' + coords[1] + '-' + coords[0]).innerHTML = "X"; + } var p=createElem("p"); p.innerHTML=strike['log']; document.getElementById('logs').appendChild(p);