refactor: alliance and Embassy mechanics refactoring, stage 2 of 3

Everything is now prepared for the last stage, where the code to handle
Embassy destruction during a battle will be added and tested :)

A few Embassy-demolition-related issues have been ironed-out in this
commit as well.
This commit is contained in:
Martin Ambrus
2017-11-01 00:16:52 +01:00
parent 6bee5aa62e
commit c9038e20b8
7 changed files with 370 additions and 84 deletions
+2 -1
View File
@@ -1996,6 +1996,7 @@ class Automation {
}
if ($tbgid==18){
$this->updateMax($database->getVillageField($data['to'],'owner'));
//$p_alliance = $database->getUserField($data['to'],"alliance",0);
}
if ($isoasis == 0) {
$pop=$this->recountPop($data['to']);
@@ -4750,7 +4751,7 @@ $wallimg = "<img src=\"".GP_LOCATE."img/g/g3".$targettribe."Icon.gif\" height=\"
}
}
private function updateMax($leader) {
public function updateMax($leader) {
global $bid18, $database;
$q = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "alidata where leader = ". (int) $leader);
if(mysqli_num_rows($q) > 0){