This commit is contained in:
Gnieark 2015-12-19 13:47:02 +01:00
parent 5093978301
commit 88d2106aa0

View File

@ -282,6 +282,7 @@ switch ($_POST['act']){
$result="hit and sunk"; $result="hit and sunk";
//remove the ship //remove the ship
unset($_SESSION['ships'][$opponent][$shipIndex]); unset($_SESSION['ships'][$opponent][$shipIndex]);
$_SESSION['ships'][$opponent] = array_values($_SESSION['ships'][$opponent]);
//var_dump($_SESSION['ships'][$opponent]); //var_dump($_SESSION['ships'][$opponent]);
//win the game? //win the game?
if(count($_SESSION['ships'][$opponent]) == 0){ if(count($_SESSION['ships'][$opponent]) == 0){