refactor: a lot of Automation foreach loops updated

#313
This commit is contained in:
Martin Ambrus
2017-11-19 14:01:30 +01:00
parent 481769b68e
commit 67d9a42506
7 changed files with 521 additions and 202 deletions
+11 -3
View File
@@ -47,6 +47,10 @@
$uid = mysqli_insert_id($database->dblink);
$admin_village_created = false;
$xcoor = 50;
$addUnitsWrefs = [];
$addTechWrefs = [];
$addABTechWrefs = [];
while (!$admin_village_created) {
$wid = $admin->getWref($xcoor++, 50);
$status = $database->getVillageState($wid);
@@ -54,12 +58,16 @@
$database->setFieldTaken($wid);
$database->addVillage($wid, $uid, $_POST['aname'], 1);
$database->addResourceFields($wid, $database->getVillageType($wid));
$database->addUnits($wid);
$database->addTech($wid);
$database->addABTech($wid);
$addUnitsWrefs[] = $wid;
$addTechWrefs[] = $wid;
$addABTechWrefs[] = $wid;
$admin_village_created = true;
}
}
$database->addUnits($addUnitsWrefs);
$database->addTech($addTechWrefs);
$database->addABTech($addABTechWrefs);
}
// set up MultiHunter