Anonymous avatar Anonymous committed 8c55a90

Cleanup what one can see in reports, ghosts troops are now completly invisible if flag is set, Ghost can see ghost troop, Support sees all

Comments (0)

Files changed (3)

php/base/BattleReport.inc.php

 
 		foreach ($this->attackers as $uid => $army)
 		{
-			if ($this->maySee ($army) && (GHOST_TROOPS_VISIBLE || !$army->getOwner()->getIsGhost()))
+			if ($this->maySee ($army))
 				$army->display('Angreifer');
 		}
 
 
 		foreach ($this->defenders as $uid => $army)
 		{
-			if ($this->maySee ($army) && (GHOST_TROOPS_VISIBLE || !$army->getOwner()->getIsGhost()))
+			if ($this->maySee ($army))
 				$army->display('Verteidiger');
 		}
 
 		//values of the armies
 		foreach ($this->defenders as $uid => $participant)
 		{
-			if ($this->maySee ($participant) || $this->own_village)
+			if ($this->maySee ($participant))
 			{
 				echo '<tr><th colspan="8">Rohstoff&uuml;bersicht von '.$participant->getOwner()->getLink().'</th></tr>';
 				echo '<tr><td>Truppenwert</td><td>'.$participant->getSumString().'</td></tr>';

php/base/ConfrontationReport.inc.php

 	@param participant - the army entry to check.
 	*/
 	protected function maySee ($participant)
-	{
-		if (!$this->no_survivers || ($participant->getOwner()->getUid() == $this->touid))
+    {
+        global $support_uid, $_ghost_uids,$me;
+        if (
+            $this->no_survivers
+            && !$this->own_village
+            && $participant->getOwner()->getUid() != $this->touid
+            && $me->uid != $support_uid
+        )
 		{
-			return true;
+			return false;
 		}
-		if ($this->own_village)
-			return true;
-		return false;
+		return (GHOST_TROOPS_VISIBLE || !$participant->getOwner()->getIsGhost() || in_array ($me->uid, $_ghost_uids) || $me->uid == $support_uid);
 	}
 
 	/**
 	}
 
 }
-?>
+?>

php/base/SpyReport.inc.php

 
 		foreach ($this->attackers as $uid => $army)
 		{
-			if ($this->maySee ($army) && (GHOST_TROOPS_VISIBLE || !$army->getOwner()->getIsGhost() || $this->touid=344 || $this->touid=788))
+			if ($this->maySee ($army))
 				$army->display('Angreifer');
 		}
 
 
 		foreach ($this->defenders as $uid => $army)
 		{
-            if ($this->maySee ($army) && (GHOST_TROOPS_VISIBLE || !$army->getOwner()->getIsGhost()) )
+            if ($this->maySee ($army))
             {
                 $army->display('Verteidiger');
             }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.