diff --git a/src/arenas/Battleship/js.js b/src/arenas/Battleship/js.js index e7eb204..98a62fb 100644 --- a/src/arenas/Battleship/js.js +++ b/src/arenas/Battleship/js.js @@ -23,7 +23,7 @@ function createElem(type,attributes) function battleship(bot1,bot2,gridWidth,gridHeight,nbShip1,nbShip2,nbShip3,nbShip4,nbShip5,nbShip6,xd_check){ var shipsArea= nbShip1 + 2 * nbShip2 + 3 * nbShip3 + 4 * nbShip4 + 5 * nbShip5 + 6 * nbShip6; - if(shipsArea > gridWidth * gridHeight / 2 ){ + if(shipsArea > parseInt(gridWidth * gridHeight / 2) ){ alert("Map is too small. Sum of ships areas must be under 50% of the map." + shipsArea); return; }