mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-24 03:57:15 +00:00
fix: destroyed Embassy evicts player even with another Embassy standing
#399
This commit is contained in:
@@ -1102,7 +1102,7 @@ class Automation {
|
|||||||
|
|
||||||
// embassy level was changed
|
// embassy level was changed
|
||||||
if ($tbgid==18){
|
if ($tbgid==18){
|
||||||
$info_cat .= $database->checkEmbassiesAfterBattle($data['to'], false);
|
$info_cat .= $database->checkEmbassiesAfterBattle($data['to'], $bdo['f'.$catapultTarget], false);
|
||||||
}
|
}
|
||||||
|
|
||||||
$info_cat .= "</td></tr></tbody>";
|
$info_cat .= "</td></tr></tbody>";
|
||||||
@@ -1111,7 +1111,7 @@ class Automation {
|
|||||||
|
|
||||||
// embassy level was changed
|
// embassy level was changed
|
||||||
if ($tbgid==18){
|
if ($tbgid==18){
|
||||||
$info_cat .= $database->checkEmbassiesAfterBattle($data['to'], false);
|
$info_cat .= $database->checkEmbassiesAfterBattle($data['to'], $bdo['f'.$catapultTarget], false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1201,7 +1201,7 @@ class Automation {
|
|||||||
|
|
||||||
// embassy level was changed
|
// embassy level was changed
|
||||||
if ( $tbgid == 18 ) {
|
if ( $tbgid == 18 ) {
|
||||||
$info_cat .= $database->checkEmbassiesAfterBattle( $data['to'], false );
|
$info_cat .= $database->checkEmbassiesAfterBattle( $data['to'], $bdo['f'.$catapultTarget], false );
|
||||||
}
|
}
|
||||||
|
|
||||||
$info_cat .= "</td></tr></tbody>";
|
$info_cat .= "</td></tr></tbody>";
|
||||||
@@ -1210,7 +1210,7 @@ class Automation {
|
|||||||
|
|
||||||
// embassy level was changed
|
// embassy level was changed
|
||||||
if ( $tbgid == 18 ) {
|
if ( $tbgid == 18 ) {
|
||||||
$info_cat .= $database->checkEmbassiesAfterBattle( $data['to'], false );
|
$info_cat .= $database->checkEmbassiesAfterBattle( $data['to'], $bdo['f'.$catapultTarget], false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4663,11 +4663,7 @@ References: User ID/Message ID, Mode
|
|||||||
// check whether this player is an alliance owner
|
// check whether this player is an alliance owner
|
||||||
$isOwner = ($userData['alliance'] && $this->isAllianceOwner($userData['id'], $use_cache) == $userData['alliance']);
|
$isOwner = ($userData['alliance'] && $this->isAllianceOwner($userData['id'], $use_cache) == $userData['alliance']);
|
||||||
|
|
||||||
// for demolition, the Embassy was already destroyed, so we need at least 1
|
$minimumExistingEmbassyRecords = 1;
|
||||||
// Embassy still standing... for battle, the Embassy is still standing
|
|
||||||
// and will only be deleted upon finalizing battle calculations, so we need
|
|
||||||
// to check for at least 2 Embassies
|
|
||||||
$minimumExistingEmbassyRecords = ($demolition ? 1 : 2);
|
|
||||||
|
|
||||||
// if they are not an alliance owner, simply check whether we have any Embassies
|
// if they are not an alliance owner, simply check whether we have any Embassies
|
||||||
// at lvl 1+ standing somewhere
|
// at lvl 1+ standing somewhere
|
||||||
@@ -4927,7 +4923,7 @@ References: User ID/Message ID, Mode
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkEmbassiesAfterBattle($vid, $use_cache = true) {
|
function checkEmbassiesAfterBattle($vid, $current_level, $use_cache = true) {
|
||||||
$userData = $this->getUserArray($this->getVillageField($vid,"owner"), 1);
|
$userData = $this->getUserArray($this->getVillageField($vid,"owner"), 1);
|
||||||
|
|
||||||
Automation::updateMax($this->getVillageField($vid,"owner"));
|
Automation::updateMax($this->getVillageField($vid,"owner"));
|
||||||
@@ -4935,7 +4931,7 @@ References: User ID/Message ID, Mode
|
|||||||
'id' => $userData['id'],
|
'id' => $userData['id'],
|
||||||
'alliance' => $userData["alliance"],
|
'alliance' => $userData["alliance"],
|
||||||
'username' => $userData["username"],
|
'username' => $userData["username"],
|
||||||
'lvl' => $totallvl
|
'lvl' => $current_level
|
||||||
], false, $use_cache);
|
], false, $use_cache);
|
||||||
|
|
||||||
if ($allianceStatus === false) {
|
if ($allianceStatus === false) {
|
||||||
|
|||||||
Reference in New Issue
Block a user