From 4b842ae0fa240d45bbb5b555312108ff182ae826 Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Sat, 2 Dec 2017 15:04:15 +0100 Subject: [PATCH] fix: village destroyed text displayed twice for 2-row catapults attack #393 --- GameEngine/Automation.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 701816d7..a743c8c7 100755 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -1095,8 +1095,10 @@ class Automation { } if ($isSecondRow) { - $info_cat .= "
Information - \"Catapult\" ".$this->procResType($tbgid,$can_destroy,$isoasis)." destroyed."; + if ($tbid > 0 || ($tbid == 0 && strpos($info_cat, 'The village has') === false)) { + $info_cat .= "
Information + \"Catapult\" " . $this->procResType( $tbgid, $can_destroy, $isoasis ) . " destroyed."; + } // embassy level was changed if ($tbgid==18){ @@ -1117,8 +1119,10 @@ class Automation { elseif ($battlepart[4]==0) { if ($isSecondRow) { - $info_cat .= "
Information - \"Catapult\" ".$this->procResType($tbgid,$can_destroy,$isoasis)." was not damaged."; + if ($tbid > 0 || ($tbid == 0 && strpos($info_cat, 'The village has') === false)) { + $info_cat .= "
Information + \"Catapult\" " . $this->procResType( $tbgid, $can_destroy, $isoasis ) . " was not damaged."; + } } else { $info_cat = "" . $catp_pic . "," . $this->procResType( $tbgid, $can_destroy, $isoasis ) . " was not damaged."; } @@ -2744,7 +2748,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")==0) { + if (strpos($info_cat,"The village has") === false) { $info_cat .= "
Information \"Catapult\" The village has been destroyed."; }