diff --git a/GameEngine/Technology.php b/GameEngine/Technology.php
index 9c7020d1..48b4bb2c 100644
--- a/GameEngine/Technology.php
+++ b/GameEngine/Technology.php
@@ -212,7 +212,7 @@ class Technology {
return $ownunit;
}
- function getAllUnits($base,$InVillageOnly=False) {
+ function getAllUnits($base,$InVillageOnly=False,$mode=0) {
global $database;
$ownunit = $database->getUnit($base);
$ownunit['u99'] -= $ownunit['u99'];
@@ -226,6 +226,7 @@ class Technology {
$ownunit['hero'] += $enforce['hero'];
}
}
+ if($mode==0){
$prisoners = $database->getPrisoners($base);
if(!empty($prisoners)) {
foreach($prisoners as $prisoner){
@@ -240,6 +241,7 @@ class Technology {
$ownunit['hero'] += $prisoner['t11'];
}
}
+ }
if(!$InVillageOnly) {
$movement = $database->getVillageMovement($base);
if(!empty($movement)) {
diff --git a/Templates/Build/36.tpl b/Templates/Build/36.tpl
index 4deffc07..5f1f9f2c 100644
--- a/Templates/Build/36.tpl
+++ b/Templates/Build/36.tpl
@@ -76,7 +76,17 @@ include("next.tpl");
foreach($trainlist as $train) {
$train_amt += $train['amt'];
}
- $max = $bid36[$village->resarray['f'.$id]]['attri'] - ($village->unitarray['u99'] + $train_amt);
+
+ $max = $technology->maxUnit(99,false);
+ $max1 = 0;
+ for($i=19;$i<41;$i++){
+ if($village->resarray['f'.$i.'t'] == 36){
+ $max1 += $bid36[$village->resarray['f'.$i]]['attri'];
+ }
+ }
+ if($max > $max1 - ($village->unitarray['u99'] + $train_amt)){
+ $max = $max1 - ($village->unitarray['u99'] + $train_amt);
+ }
if($max < 0){
$max = 0;
}
diff --git a/Templates/Notice/1.tpl b/Templates/Notice/1.tpl
index a3ad9c66..d92c07e3 100644
--- a/Templates/Notice/1.tpl
+++ b/Templates/Notice/1.tpl
@@ -75,7 +75,7 @@ for($i=151;$i<=160;$i++) {
echo "
".$dataarray[$i]." | ";
}
}
-if(isset($dataarray[161]) and $dataarray[161]!=0){
+if(isset($dataarray[147]) and $dataarray[147]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "$dataarray[161] | ";
}
diff --git a/Templates/Notice/1x.tpl b/Templates/Notice/1x.tpl
index 7d4eb444..bb251bc7 100644
--- a/Templates/Notice/1x.tpl
+++ b/Templates/Notice/1x.tpl
@@ -78,7 +78,7 @@ for($i=151;$i<=160;$i++) {
echo "".$dataarray[$i]." | ";
}
}
-if(isset($dataarray[161]) and $dataarray[161]!=0){
+if(isset($dataarray[147]) and $dataarray[147]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "$dataarray[161] | ";
}
diff --git a/Templates/Notice/2.tpl b/Templates/Notice/2.tpl
index a3ad9c66..d92c07e3 100644
--- a/Templates/Notice/2.tpl
+++ b/Templates/Notice/2.tpl
@@ -75,7 +75,7 @@ for($i=151;$i<=160;$i++) {
echo "".$dataarray[$i]." | ";
}
}
-if(isset($dataarray[161]) and $dataarray[161]!=0){
+if(isset($dataarray[147]) and $dataarray[147]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "$dataarray[161] | ";
}
diff --git a/Templates/Notice/2x.tpl b/Templates/Notice/2x.tpl
index 7d4eb444..bb251bc7 100644
--- a/Templates/Notice/2x.tpl
+++ b/Templates/Notice/2x.tpl
@@ -78,7 +78,7 @@ for($i=151;$i<=160;$i++) {
echo "".$dataarray[$i]." | ";
}
}
-if(isset($dataarray[161]) and $dataarray[161]!=0){
+if(isset($dataarray[147]) and $dataarray[147]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "$dataarray[161] | ";
}
diff --git a/Templates/Notice/3.tpl b/Templates/Notice/3.tpl
index 9d8c1b92..df5f3a0b 100644
--- a/Templates/Notice/3.tpl
+++ b/Templates/Notice/3.tpl
@@ -77,7 +77,7 @@ for($i=153;$i<=162;$i++) {
echo "".$dataarray[$i]." | ";
}
}
-if(isset($dataarray[163]) and $dataarray[163]!=0){
+if(isset($dataarray[151]) and $dataarray[151]!=0){
if ($dataarray[163]==0){$tdclass='class="none"';}
echo "$dataarray[163] | ";
}
diff --git a/Templates/Notice/3x.tpl b/Templates/Notice/3x.tpl
index 95c12b56..127d1915 100644
--- a/Templates/Notice/3x.tpl
+++ b/Templates/Notice/3x.tpl
@@ -80,7 +80,7 @@ for($i=153;$i<=162;$i++) {
echo "".$dataarray[$i]." | ";
}
}
-if(isset($dataarray[163]) and $dataarray[163]!=0){
+if(isset($dataarray[151]) and $dataarray[151]!=0){
if ($dataarray[163]==0){$tdclass='class="none"';}
echo "$dataarray[163] | ";
}
diff --git a/Templates/Notice/4.tpl b/Templates/Notice/4.tpl
index a3ad9c66..d92c07e3 100644
--- a/Templates/Notice/4.tpl
+++ b/Templates/Notice/4.tpl
@@ -75,7 +75,7 @@ for($i=151;$i<=160;$i++) {
echo "".$dataarray[$i]." | ";
}
}
-if(isset($dataarray[161]) and $dataarray[161]!=0){
+if(isset($dataarray[147]) and $dataarray[147]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "$dataarray[161] | ";
}
diff --git a/Templates/Notice/4x.tpl b/Templates/Notice/4x.tpl
index 7d4eb444..bb251bc7 100644
--- a/Templates/Notice/4x.tpl
+++ b/Templates/Notice/4x.tpl
@@ -78,7 +78,7 @@ for($i=151;$i<=160;$i++) {
echo "".$dataarray[$i]." | ";
}
}
-if(isset($dataarray[161]) and $dataarray[161]!=0){
+if(isset($dataarray[147]) and $dataarray[147]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "$dataarray[161] | ";
}
diff --git a/Templates/Notice/5.tpl b/Templates/Notice/5.tpl
index a3ad9c66..d92c07e3 100644
--- a/Templates/Notice/5.tpl
+++ b/Templates/Notice/5.tpl
@@ -75,7 +75,7 @@ for($i=151;$i<=160;$i++) {
echo "".$dataarray[$i]." | ";
}
}
-if(isset($dataarray[161]) and $dataarray[161]!=0){
+if(isset($dataarray[147]) and $dataarray[147]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "$dataarray[161] | ";
}
diff --git a/Templates/Notice/5x.tpl b/Templates/Notice/5x.tpl
index 7d4eb444..bb251bc7 100644
--- a/Templates/Notice/5x.tpl
+++ b/Templates/Notice/5x.tpl
@@ -78,7 +78,7 @@ for($i=151;$i<=160;$i++) {
echo "".$dataarray[$i]." | ";
}
}
-if(isset($dataarray[161]) and $dataarray[161]!=0){
+if(isset($dataarray[147]) and $dataarray[147]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "$dataarray[161] | ";
}
diff --git a/Templates/Notice/6.tpl b/Templates/Notice/6.tpl
index a3ad9c66..d92c07e3 100644
--- a/Templates/Notice/6.tpl
+++ b/Templates/Notice/6.tpl
@@ -75,7 +75,7 @@ for($i=151;$i<=160;$i++) {
echo "".$dataarray[$i]." | ";
}
}
-if(isset($dataarray[161]) and $dataarray[161]!=0){
+if(isset($dataarray[147]) and $dataarray[147]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "$dataarray[161] | ";
}
diff --git a/Templates/Notice/6x.tpl b/Templates/Notice/6x.tpl
index 7d4eb444..bb251bc7 100644
--- a/Templates/Notice/6x.tpl
+++ b/Templates/Notice/6x.tpl
@@ -78,7 +78,7 @@ for($i=151;$i<=160;$i++) {
echo "".$dataarray[$i]." | ";
}
}
-if(isset($dataarray[161]) and $dataarray[161]!=0){
+if(isset($dataarray[147]) and $dataarray[147]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "$dataarray[161] | ";
}
diff --git a/Templates/Notice/7.tpl b/Templates/Notice/7.tpl
index 593b0815..f84b477c 100644
--- a/Templates/Notice/7.tpl
+++ b/Templates/Notice/7.tpl
@@ -72,7 +72,7 @@ for($i=151;$i<=160;$i++) {
echo "".$dataarray[$i]." | ";
}
}
-if(isset($dataarray[161]) and $dataarray[161]!=0){
+if(isset($dataarray[147]) and $dataarray[147]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "$dataarray[161] | ";
}
diff --git a/Templates/Notice/7x.tpl b/Templates/Notice/7x.tpl
index 42f8b0dd..313d9e70 100644
--- a/Templates/Notice/7x.tpl
+++ b/Templates/Notice/7x.tpl
@@ -77,7 +77,7 @@ for($i=151;$i<=160;$i++) {
echo "".$dataarray[$i]." | ";
}
}
-if(isset($dataarray[161]) and $dataarray[161]!=0){
+if(isset($dataarray[147]) and $dataarray[147]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "$dataarray[161] | ";
}
diff --git a/Templates/troops.tpl b/Templates/troops.tpl
index 207917f9..bb419396 100644
--- a/Templates/troops.tpl
+++ b/Templates/troops.tpl
@@ -14,7 +14,7 @@
|
getAllUnits($village->wid,True);
+$troops = $technology->getAllUnits($village->wid,True,1);
$TroopsPresent = False;
for($i=1;$i<=50;$i++) {
if($troops['u'.$i] > 0) {