From dc5ecf3c7a20fb5cfc67d3dbfffe99f5c58a53b6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2012 01:00:07 +0300 Subject: [PATCH] now ally attacks work fine (except scouts, I save it for later when fix all scouts type) --- Templates/Alliance/attack-attacker.tpl | 8 ++------ Templates/Alliance/attack-defender.tpl | 7 ++----- Templates/Alliance/attacks.tpl | 13 +++++++++++-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Templates/Alliance/attack-attacker.tpl b/Templates/Alliance/attack-attacker.tpl index 3411970e..e1dcc4ed 100644 --- a/Templates/Alliance/attack-attacker.tpl +++ b/Templates/Alliance/attack-attacker.tpl @@ -1,6 +1,6 @@ alliance AND $limit ORDER BY time DESC LIMIT 20"); $query = mysql_num_rows($sql); $outputList = ''; @@ -38,11 +38,7 @@ 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); - }else{ - $getUserAlly = $database->getUserField($dataarray[30],alliance,0); - } + $getUserAlly = $database->getUserField($dataarray[28],alliance,0); $getAllyName = $database->getAllianceName($getUserAlly); if($getUserAlly==$session->alliance || !$getUserAlly){ diff --git a/Templates/Alliance/attack-defender.tpl b/Templates/Alliance/attack-defender.tpl index fdeb38da..8a77b848 100644 --- a/Templates/Alliance/attack-defender.tpl +++ b/Templates/Alliance/attack-defender.tpl @@ -12,6 +12,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"]; @@ -38,11 +39,7 @@ 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); - }else{ - $getUserAlly = $database->getUserField($dataarray[30],alliance,0); - } + $getUserAlly = $database->getUserField($dataarray[0],alliance,0); $getAllyName = $database->getAllianceName($getUserAlly); if($getUserAlly==$session->alliance || !$getUserAlly){ diff --git a/Templates/Alliance/attacks.tpl b/Templates/Alliance/attacks.tpl index deccf916..0194de51 100644 --- a/Templates/Alliance/attacks.tpl +++ b/Templates/Alliance/attacks.tpl @@ -67,13 +67,22 @@ if($ntype==4 || $ntype==5 || $ntype==6 || $ntype==7){ $outputList .= $nn; $outputList .= $database->getUserField($dataarray[28],username,0); if($ntype==0){ + $isoasis = $database->isVillageOases($toWref); + if($isoasis == 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){ + }else{ + if($toWref != $village->wid){ + $getUser = $database->getOasisField($toWref,owner); + }else{ + $getUser = $database->getOasisField($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[0],alliance,0);