mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-09-23 02:17:05 +08:00
fix maximum traps to train
This commit is contained in:
@@ -455,7 +455,7 @@ private function trainUnit($unit,$amt,$great=false) {
|
|||||||
$amt = 0;
|
$amt = 0;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$max = $bid36[$building->getTypeLevel(36)]['attri'] - $village->unitarray['u99'];
|
$max = $bid36[$village->resarray['f'.$id]]['attri'] - ($village->unitarray['u99'] + $train_amt);
|
||||||
if($max <= $amt) {
|
if($max <= $amt) {
|
||||||
$amt = 0;
|
$amt = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
$max = $bid36[$village->resarray['f'.$id]]['attri'] - $village->unitarray['u99'];
|
$trainlist = $technology->getTrainingList(8);
|
||||||
|
foreach($trainlist as $train) {
|
||||||
|
$train_amt += $train['amt'];
|
||||||
|
}
|
||||||
|
$max = $bid36[$village->resarray['f'.$id]]['attri'] - ($village->unitarray['u99'] + $train_amt);
|
||||||
if($max < 0){
|
if($max < 0){
|
||||||
$max = 0;
|
$max = 0;
|
||||||
}
|
}
|
||||||
@@ -88,7 +92,6 @@
|
|||||||
} else {
|
} else {
|
||||||
echo "<b>Training can commence when trapper are completed.</b><br>\n";
|
echo "<b>Training can commence when trapper are completed.</b><br>\n";
|
||||||
}
|
}
|
||||||
$trainlist = $technology->getTrainingList(8);
|
|
||||||
if(count($trainlist) > 0) {
|
if(count($trainlist) > 0) {
|
||||||
echo "
|
echo "
|
||||||
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
|
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
|
||||||
|
|||||||
Reference in New Issue
Block a user