mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-11 07:06:06 +00:00
fix ww buildingplans, fix pop and cp of ww and buildingplan villages, fix dissapering of chief when conquer village and add select password for create natars
This commit is contained in:
@@ -98,6 +98,26 @@ class Automation {
|
||||
return $popTot;
|
||||
|
||||
}
|
||||
|
||||
function recountCP($vid){
|
||||
global $database;
|
||||
$fdata = $database->getResourceLevel($vid);
|
||||
$popTot = 0;
|
||||
|
||||
for ($i = 1; $i <= 40; $i++) {
|
||||
$lvl = $fdata["f".$i];
|
||||
$building = $fdata["f".$i."t"];
|
||||
if($building){
|
||||
$popTot += $this->buildingCP($building,$lvl);
|
||||
}
|
||||
}
|
||||
|
||||
$q = "UPDATE ".TB_PREFIX."vdata set pop = $popTot where wref = $vid";
|
||||
mysql_query($q);
|
||||
|
||||
return $popTot;
|
||||
|
||||
}
|
||||
|
||||
function buildingPOP($f,$lvl){
|
||||
$name = "bid".$f;
|
||||
@@ -109,6 +129,18 @@ class Automation {
|
||||
$popT += $dataarray[$i]['pop'];
|
||||
}
|
||||
return $popT;
|
||||
}
|
||||
|
||||
function buildingCP($f,$lvl){
|
||||
$name = "bid".$f;
|
||||
global $$name;
|
||||
$popT = 0;
|
||||
$dataarray = $$name;
|
||||
|
||||
for ($i = 0; $i <= $lvl; $i++) {
|
||||
$popT += $dataarray[$i]['cp'];
|
||||
}
|
||||
return $popT;
|
||||
}
|
||||
|
||||
public function Automation() {
|
||||
@@ -1122,7 +1154,7 @@ class Automation {
|
||||
$troopsdead6 = $dead6;
|
||||
$troopsdead7 = $dead7;
|
||||
$troopsdead8 = $dead8;
|
||||
$troopsdead9 = $dead9-1;
|
||||
$troopsdead9 = $dead9+1;
|
||||
$troopsdead10 = $dead10;
|
||||
$troopsdead11 = $dead11;
|
||||
for($i=1;$i<=50;$i++) {
|
||||
|
||||
Reference in New Issue
Block a user