From 9474a60313e37a5b78ac384f0dbabf51d176e50c Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Sat, 2 Dec 2017 10:55:24 +0100 Subject: [PATCH] fix: embassy destruction status text on an incorrect line in a report #393 --- GameEngine/Automation.php | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 95b437f9..54462742 100755 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -1084,11 +1084,6 @@ class Automation { $database->setMaxCropForVillage($data['to'], $buildarray[$tblevel]['attri']); } - // embassy level was changed - if ($tbgid==18){ - $info_cat .= $database->checkEmbassiesAfterBattle($data['to'], false); - } - // oasis cannot be destroyed $pop=$this->recountPop($data['to'], false); if ($isoasis == 0) { @@ -1101,9 +1096,21 @@ class Automation { if ($isSecondRow) { $info_cat .= "
Information - \"Catapult\" ".$this->procResType($tbgid,$can_destroy,$isoasis)." destroyed."; + \"Catapult\" ".$this->procResType($tbgid,$can_destroy,$isoasis)." destroyed."; + + // embassy level was changed + if ($tbgid==18){ + $info_cat .= $database->checkEmbassiesAfterBattle($data['to'], false); + } + + $info_cat .= ""; } else { $info_cat = "" . $catp_pic . ", " . $this->procResType( $tbgid, $can_destroy, $isoasis ) . " destroyed."; + + // embassy level was changed + if ($tbgid==18){ + $info_cat .= $database->checkEmbassiesAfterBattle($data['to'], false); + } } } // building/field not damaged @@ -1161,11 +1168,6 @@ class Automation { if ( $tbgid == 11 || $tbgid == 39 ) { $database->setMaxCropForVillage( $data['to'], $buildarray[ $tblevel ]['attri'] ); } - - // embassy level was changed - if ( $tbgid == 18 ) { - $info_cat .= $database->checkEmbassiesAfterBattle( $data['to'], false ); - } } $fieldsToSet = ["f" . $tbid]; @@ -1191,9 +1193,21 @@ class Automation { if ($isSecondRow) { $info_cat .= "
Information - \"Catapult\" ".$this->procResType($tbgid,$can_destroy,$isoasis).$info_cata.""; + \"Catapult\" ".$this->procResType($tbgid,$can_destroy,$isoasis).$info_cata; + + // embassy level was changed + if ( $tbgid == 18 ) { + $info_cat .= $database->checkEmbassiesAfterBattle( $data['to'], false ); + } + + $info_cat .= ""; } else { $info_cat = "" . $catp_pic . "," . $this->procResType( $tbgid, $can_destroy, $isoasis ) . $info_cata; + + // embassy level was changed + if ( $tbgid == 18 ) { + $info_cat .= $database->checkEmbassiesAfterBattle( $data['to'], false ); + } } } }