From 8aad98dbb798a7cc08d7f5fb33b4aa0ff533b183 Mon Sep 17 00:00:00 2001 From: Pietro Date: Wed, 4 Apr 2018 15:41:04 +0200 Subject: [PATCH] Fixed a bug in the map Enforcements/scouts/attacks are now tracked in the map if you've a plus account. --- GameEngine/Session.php | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/GameEngine/Session.php b/GameEngine/Session.php index abff455c..ea31e5ec 100755 --- a/GameEngine/Session.php +++ b/GameEngine/Session.php @@ -273,7 +273,36 @@ class Session { $this->CheckHeroReal(); } } - + + /** + * Creates an array with the vrefs of attacked/scouted/reinforced villages and oasis + * + */ + + public function populateAttacks(){ + global $database, $village; + + $troopsMovement = $database->getMovement(3, $village->wid, 0); + + if(count($troopsMovement) > 0){ + foreach($troopsMovement as $movement) + { + switch($movement['attack_type']){ + case 1: + $_SESSION['troops_movement']['scouts'][] = $movement['to']; + break; + case 2: + $_SESSION['troops_movement']['enforcements'][] = $movement['to']; + break; + case 3: + case 4: + $_SESSION['troops_movement']['attacks'][] = $movement['to']; + break; + } + } + } + } + private function SurfControl(){ if(SERVER_WEB_ROOT) { $page = $_SERVER['SCRIPT_NAME'];