Update Units.php

This commit is contained in:
Shadow
2014-02-18 08:26:33 +02:00
parent 102d42e731
commit 06af170c47
+7 -7
View File
@@ -74,8 +74,8 @@ class Units {
} }
private function loadUnits($post) { private function loadUnits($post) {
global $database,$village,$session,$generator,$logging,$form; global $database,$village,$session,$generator,$logging,$form;
// Busqueda por nombre de pueblo // Search by town name
// Confirmamos y buscamos las coordenadas por nombre de pueblo // Coordinates and look confirm name people
if(isset($post['x']) && isset($post['y']) && $post['x'] != "" && $post['y'] != "") { if(isset($post['x']) && isset($post['y']) && $post['x'] != "" && $post['y'] != "") {
$vid = $database->getVilWref($post['x'],$post['y']); $vid = $database->getVilWref($post['x'],$post['y']);
unset($post['dname']); unset($post['dname']);
@@ -141,8 +141,8 @@ class Units {
} }
} }
// Busqueda por coordenadas de pueblo // People search by coordinates
// Confirmamos y buscamos las coordenadas por coordenadas de pueblo // We confirm and seek coordinate coordinates Village
if(isset($post['x']) && isset($post['y']) && $post['x'] != "" && $post['y'] != "") { if(isset($post['x']) && isset($post['y']) && $post['x'] != "" && $post['y'] != "") {
$coor = array('x'=>$post['x'], 'y'=>$post['y']); $coor = array('x'=>$post['x'], 'y'=>$post['y']);
$id = $generator->getBaseID($coor['x'],$coor['y']); $id = $generator->getBaseID($coor['x'],$coor['y']);
@@ -191,14 +191,14 @@ class Units {
$form->addError("error","You cant attack same village you are sending from."); $form->addError("error","You cant attack same village you are sending from.");
//break; //break;
} }
// Procesamos el array con los errores dados en el formulario // We process the array with the errors given in the form
if($form->returnErrors() > 0) { if($form->returnErrors() > 0) {
$_SESSION['errorarray'] = $form->getErrors(); $_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $_POST; $_SESSION['valuearray'] = $_POST;
header("Location: a2b.php"); header("Location: a2b.php");
}else{ }else{
// Debemos devolver un array con $post, que contiene todos los datos mas // We must return an array with $ post, which contains all the data more
// otra variable que definira que el flag esta levantado y se va a enviar y el tipo de envio // another variable that will define the flag is raised and is being sent and the type of shipping
$villageName = $database->getVillageField($id,'name'); $villageName = $database->getVillageField($id,'name');
$speed= 300; $speed= 300;
$timetaken = $generator->procDistanceTime($coor,$village->coor,INCREASE_SPEED,1); $timetaken = $generator->procDistanceTime($coor,$village->coor,INCREASE_SPEED,1);