General fixes

+Fixed a bug that showed "The village has been destroyed" two times, if
an artifact was conquered from Natars (or from a 0 popped village) and
there were catapults in the attack
This commit is contained in:
iopietro
2018-07-25 02:43:29 +02:00
parent ee0b4984c2
commit 84b00790a6
+2 -2
View File
@@ -2184,7 +2184,7 @@ class Automation {
// if the defender pop is 0 with no artefact, then destroy the village
if($database->getVillageField($data['to'], "pop") == 0 || $targettribe == 5){
$can_destroy = $village_destroyed = 1;
$info_hero .= " The village has been destroyed.";
if(strpos($info_cat, "The village has") === false) $info_hero .= " The village has been destroyed.";
}
}
else $info_hero = $hero_pic.",".$artifactError.$xp;
@@ -2233,7 +2233,7 @@ class Automation {
}else{
if(isset($village_destroyed) && $village_destroyed == 1 && $can_destroy==1){
//check if village pop=0 and no info destroy
if (strpos($info_cat,"The village has") === false) {
if (strpos($info_cat, "The village has") === false) {
$info_cat .= "<tbody class=\"goods\"><tr><th>Information</th><td colspan=\"11\">
<img class=\"unit u".$catp_pic."\" src=\"img/x.gif\" alt=\"Catapult\" title=\"Catapult\" /> The village has been destroyed.</td></tr></tbody>";
}