Skip to content

Commit

Permalink
Merge pull request #592 from arafarn12/master
Browse files Browse the repository at this point in the history
fix bug calculate training settlers/chiefs
  • Loading branch information
Shadowss authored Aug 27, 2019
2 parents 693afb4 + 4f4e623 commit 233b53f
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions GameEngine/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -7164,22 +7164,16 @@ public function getAvailableExpansionTraining() {
}
}

$q = "SELECT (u10+u20+u30) FROM " . TB_PREFIX . "enforcement WHERE `from` = ".(int) $village->wid;
$q = "SELECT (u10+u20+u30) as sumsettlers FROM " . TB_PREFIX . "enforcement WHERE `from` = ".(int) $village->wid;
$result = mysqli_query($this->dblink,$q);
$row = mysqli_fetch_row($result);
if(!empty($row)) {
foreach($row as $reinf) {
$settlers += $reinf[0];
}
while($settlersrow = mysqli_fetch_array($result)) {
$settlers += $settlersrow["sumsettlers"];
}

$q = "SELECT (u9+u19+u29) FROM " . TB_PREFIX . "enforcement WHERE `from` = ".(int) $village->wid;
$q = "SELECT (u9+u19+u29) as sumchiefs FROM " . TB_PREFIX . "enforcement WHERE `from` = ".(int) $village->wid;
$result = mysqli_query($this->dblink,$q);
$row = mysqli_fetch_row($result);
if(!empty($row)) {
foreach($row as $reinf) {
$chiefs += $reinf[0];
}
while($chiefsrow = mysqli_fetch_array($result)) {
$chiefs += $chiefsrow["sumchiefs"];
}

$trainlist = $technology->getTrainingList(4);
Expand Down

0 comments on commit 233b53f

Please sign in to comment.