fix faster troop training artefact

This commit is contained in:
unknown
2012-06-10 15:37:16 +03:00
parent a2ff2b3791
commit 72b8ddf9c2
+22 -1
View File
@@ -2293,6 +2293,26 @@
$time = $queued[count($queued) - 1]['commence'] + $queued[count($queued) - 1]['eachtime'] * $queued[count($queued) - 1]['amt'];
}
$now = time();
$uid = $this->getVillageField($vid, "owner");
$artefact = count($this->getOwnUniqueArtefactInfo2($uid,5,3,0));
$artefact1 = count($this->getOwnUniqueArtefactInfo2($vid,5,1,1));
$artefact2 = count($this->getOwnUniqueArtefactInfo2($uid,5,2,0));
if($artefact > 0){
$time = $now+round(($time-$now)/2);
$each /= 2;
$each = round($each);
}else if($artefact1 > 0){
$time = $now+round(($time-$now)/2);
$each /= 2;
$each = round($each);
}else if($artefact2 > 0){
$time = $now+round(($time-$now)/4*3);
$each /= 4;
$each = round($each);
$each *= 3;
$each = round($each);
}
$q = "INSERT INTO " . TB_PREFIX . "training values (0,$vid,$unit,$amt,$pop,$now,$each,$time)";
} else {
$q = "DELETE FROM " . TB_PREFIX . "training where id = $vid";
@@ -2803,7 +2823,8 @@
}else{
$q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE vref = $id AND type = $type AND size=$size";
}
return mysql_query($q, $this->connection);
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getArtefactInfo() {