This commit is contained in:
Gnieark 2015-12-18 21:45:00 +01:00
parent bf79dad577
commit 2346bfa242
2 changed files with 11 additions and 2 deletions

View File

@ -268,10 +268,16 @@ switch ($_POST['act']){
'target' => $x.",".$y,
'result' => $result
);
if(count( $_SESSION['strikes'][$currentPlayer]) < 10){
$continue=1;
}else{
$continue=0;
}
echo json_encode(array(
'opponent'=> $opponent,
'target' => $x.",".$y,
'log' => $currentBot['name']."tire en ".$x.",".$y." ".$result
'log' => $currentBot['name']."tire en ".$x.",".$y." ".$result,
'continue' => $continue
));
die;

View File

@ -36,7 +36,10 @@ function fight(xd_check){
var p=createElem("p");
p.innerHTML=strike['log'];
document.getElementById('logs').appendChild(p);
//fight(xd_check);
if( strike['continue'] == 1){
fight(xd_check);
}
}