From 5a2237611f538a1133434e3eb19598380cab0de3 Mon Sep 17 00:00:00 2001 From: armando1980 Date: Sat, 25 Jan 2014 13:15:18 -0500 Subject: [PATCH 1/2] FIXED spies BY Armando if the defender does not have spies, the attacker will not die spies. FIXED BY Armando --- GameEngine/Automation.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 0d39f1dc..5194eb84 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -1454,7 +1454,25 @@ class Automation { ${dead.$i}=$data['t'.$i]; }else { ${dead.$i} = $battlepart['casualties_attacker'][$i]; } } - + //if the defender does not have spies, the attacker will not die spies. FIXED BY Armando + if($scout){ + $spy_def_Detect=0; + for($i=1;$i<=(50);$i++) { + if($i == 4 || $i == 14 || $i == 23 || $i == 34 || $i == 44){ + if($Defender['u'.$i]>0) { + $spy_def_Detect=$i; + break; + } + } + } + + } + if($spy_def_Detect==0) { + $dead3=0; + $dead4=0; + $battlepart['casualties_attacker'][3]=0; + $battlepart['casualties_attacker'][4]=0; + } ################################################# $dead=array(); From 65c9504ced4be7ab35b7d5d67082c0d3fdd98099 Mon Sep 17 00:00:00 2001 From: armando1980 Date: Tue, 28 Jan 2014 17:12:25 -0500 Subject: [PATCH 2/2] I made a small mistake and fixed I made a small mistake and fixed --- GameEngine/Automation.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 5194eb84..b6c49cac 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -1465,14 +1465,14 @@ class Automation { } } } - - } - if($spy_def_Detect==0) { + if($spy_def_Detect==0) { $dead3=0; $dead4=0; $battlepart['casualties_attacker'][3]=0; $battlepart['casualties_attacker'][4]=0; - } + } + } + ################################################# $dead=array();