diff --git a/Templates/goldClub/farmlist_addraid.tpl b/Templates/goldClub/farmlist_addraid.tpl index 5adfcdbc..18ec9113 100644 --- a/Templates/goldClub/farmlist_addraid.tpl +++ b/Templates/goldClub/farmlist_addraid.tpl @@ -5,7 +5,7 @@ if(!$database->getVilFarmlist($session->uid)){ exit; } -if(isset($_POST['action']) && $_POST['action'] == 'addSlot' && isset($_POST['lid']) && $database->getFLData($_POST['lid'])['owner'] == $session->uid) { +if(isset($_POST['action']) && $_POST['action'] == 'addSlot' && isset($_POST['lid']) && ($FLData = $database->getFLData($_POST['lid']))['owner'] == $session->uid) { $troops = 0; for($i = 1; $i <= 6; $i++){ @@ -34,7 +34,7 @@ if(isset($_POST['action']) && $_POST['action'] == 'addSlot' && isset($_POST['lid elseif($oasistype == 0 && $vdata == 0) $errormsg = "There is no village on those coordinates."; elseif($troops == 0) $errormsg = "No troops has been selected."; elseif($database->hasBeginnerProtection($Wref) == 1) $errormsg = "Player under protection."; - elseif($_POST['target_id'] == $village->wid || $vdata['wref'] == $village->wid) $errormsg = "You can't attack the same village you send troops from."; + elseif($_POST['target_id'] == $FLData['wref'] || $vdata['wref'] == $FLData['wref']) $errormsg = "You can't attack the same village you're sending troops from."; else { if(!empty($_POST['target_id'])){ diff --git a/Templates/goldClub/farmlist_editraid.tpl b/Templates/goldClub/farmlist_editraid.tpl index 1ca54f80..e9a66f6d 100644 --- a/Templates/goldClub/farmlist_editraid.tpl +++ b/Templates/goldClub/farmlist_editraid.tpl @@ -14,7 +14,9 @@ if(isset($_GET['action']) == 'editSlot' && $_GET['eid']) { } if(isset($_POST['action']) == 'editSlot' && isset($_GET['eid']) && !empty($_GET['eid']) && isset($_POST['lid']) && !empty($_POST['lid'])) { - if(!empty($_POST['target_id'])){ + + $FLData = $database->getFLData($_POST['lid']); + if(!empty($_POST['target_id'])){ $Wref = $_POST['target_id']; $WrefCoor = $database->getCoor($Wref); $WrefX = $WrefCoor['x']; @@ -41,7 +43,7 @@ if(isset($_POST['action']) == 'editSlot' && isset($_GET['eid']) && !empty($_GET[ elseif($oasistype == 0 && $vdata == 0) $errormsg = "There is no village on those coordinates."; elseif($troops == 0) $errormsg = "No troops has been selected."; elseif($database->hasBeginnerProtection($Wref) == 1) $errormsg = "Player under protection."; - elseif($_POST['target_id'] == $village->wid || $vdata['wref'] == $village->wid) $errormsg = "You can't attack the same village you send troops from."; + elseif($_POST['target_id'] == $FLData['wref'] || $vdata['wref'] == $FLData['wref']) $errormsg = "You can't attack the same village you're sending troops from."; else { if(!empty($_POST['target_id'])){ diff --git a/todo.txt b/todo.txt index 8fe72615..ce5c3232 100644 --- a/todo.txt +++ b/todo.txt @@ -1,6 +1,6 @@ - shouldn't we create accounts from middle towards corners, not middle-corners-everywhere? + change "incoming attacker" title of the raid list icon when actually attacking a farm (it should be "Own attacking troops") -- change "select all" button to actually select all checkboxes via JS, not via page reload ++ change "select all" button to actually select all checkboxes via JS, not via page reload - make sure that when auto-removing inactive players, anyone who have units going there + anyone with them in their raid lists etc. gets notified and sorted out - display "send troops" link for own villages, so we don't have to enter coordinates or search by name (which can search good name but wrong owner!) - check the following queries for performing stuff on DB rather than in PHP: