From 25e6da2e1385efee853a890b083ee5cd84155071 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2012 00:34:03 +0300 Subject: [PATCH] fix alliance attacks 100% --- Templates/Alliance/attacks.tpl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Templates/Alliance/attacks.tpl b/Templates/Alliance/attacks.tpl index 71ede069..deccf916 100644 --- a/Templates/Alliance/attacks.tpl +++ b/Templates/Alliance/attacks.tpl @@ -39,6 +39,7 @@ while($row = mysql_fetch_array($sql)){ $dataarray = explode(",",$row['data']); $id = $row["id"]; $uid = $row["uid"]; + $toWref = $row["toWref"]; $ally = $row["ally"]; $topic = $row["topic"]; $ntype = $row["ntype"]; @@ -65,10 +66,17 @@ if($ntype==4 || $ntype==5 || $ntype==6 || $ntype==7){ $outputList .= $nn; $outputList .= $database->getUserField($dataarray[28],username,0); - if($ntype==0 or $ntype==1 or $ntype==2 or $ntype==3){ - $getUserAlly = $database->getUserField($dataarray[0],alliance,0); + if($ntype==0){ + if($toWref != $village->wid){ + $getUser = $database->getVillageField($toWref,owner); + }else{ + $getUser = $database->getVillageField($dataarray[1],owner); + } + $getUserAlly = $database->getUserField($getUser,alliance,0); + }else if($ntype==1 or $ntype==2 or $ntype==3){ + $getUserAlly = $database->getUserField($dataarray[28],alliance,0); }else{ - $getUserAlly = $database->getUserField($dataarray[30],alliance,0); + $getUserAlly = $database->getUserField($dataarray[0],alliance,0); } $getAllyName = $database->getAllianceName($getUserAlly);