place ships function

This commit is contained in:
gnieark 2015-12-17 22:03:19 +01:00
parent efb974deee
commit 5cf7dd2615

View File

@ -119,9 +119,9 @@ switch ($_POST['act']){
list($xStart,$yStart)=explode(",",$startCoord);
list($xEnd,$yEnd)=explode(",",$endCoord);
if($xStart == $xEnd){
$long=abs($yStart - $yEnd +1);
$long=abs($yStart - $yEnd) +1;
}else{
$long=abs($xStart - $xEnd +1);
$long=abs($xStart - $xEnd) +1;
}
$nbBoatsIwant[$long]-=1;
$grid[$player]=place_ship_on_map($xStart,$yStart,$xEnd,$yEnd,$grid[$player]);