General fixes

+Moved "isWinner()" method from Automation.php to Session.php, it's now
triggered when activating plus function or entering in
plus1.php/build.php
+General clean-up and better indentation
+The tournament square bonus is now displayed correctly
This commit is contained in:
iopietro
2018-05-22 00:33:09 +02:00
parent e1b0dcf46e
commit f0b9f32826
18 changed files with 239 additions and 267 deletions
+4 -10
View File
@@ -23,25 +23,19 @@ if(isset($_GET['z'])) {
$y = $currentcoor['y'];
$x = $currentcoor['x'];
$bigmid = $_GET['z'];
}
else if(isset($_POST['xp']) && isset($_POST['yp'])){
}else if(isset($_POST['xp']) && isset($_POST['yp'])){
$x = $_POST['xp'];
$y = $_POST['yp'];
$bigmid = $generator->getBaseID($x,$y);
}
else {
}else{
$y = $village->coor['y'];
$x = $village->coor['x'];
$bigmid = $village->wid;
}
if(isset($_SESSION['troops_movement'])){
unset($_SESSION['troops_movement']);
}
if(isset($_SESSION['troops_movement'])) unset($_SESSION['troops_movement']);
if($session->plus){
$session->populateAttacks();
}
if($session->plus) $session->populateAttacks();
$xm7 = ($x-7) < -WORLD_MAX? $x+WORLD_MAX+WORLD_MAX-6 : $x-7;
$xm3 = ($x-3) < -WORLD_MAX? $x+WORLD_MAX+WORLD_MAX-2 : $x-3;
+4 -10
View File
@@ -20,25 +20,19 @@ if(isset($_GET['z'])){
$y = $currentcoor['y'];
$x = $currentcoor['x'];
$bigmid = $_GET['z'];
}
else if(isset($_POST['xp']) && isset($_POST['yp'])){
}else if(isset($_POST['xp']) && isset($_POST['yp'])){
$x = $_POST['xp'];
$y = $_POST['yp'];
$bigmid = $generator->getBaseID($x,$y);
}
else{
}else{
$y = $village->coor['y'];
$x = $village->coor['x'];
$bigmid = $village->wid;
}
if(isset($_SESSION['troops_movement'])){
unset($_SESSION['troops_movement']);
}
if(isset($_SESSION['troops_movement'])) unset($_SESSION['troops_movement']);
if($session->plus){
$session->populateAttacks();
}
if($session->plus) $session->populateAttacks();
$xm7 = ($x-7) < -WORLD_MAX? $x+WORLD_MAX+WORLD_MAX-6 : $x-7;
$xm6 = ($x-6) < -WORLD_MAX? $x+WORLD_MAX+WORLD_MAX-5 : $x-6;