fix: cannot send traders to village determined by a village name

This commit is contained in:
Martin Ambrus
2017-11-19 23:37:38 +01:00
parent 37c53a30f5
commit 1747a26c1e
3 changed files with 327 additions and 324 deletions
+4 -1
View File
@@ -3471,7 +3471,10 @@ class Automation {
//add unit. //add unit.
$j='1'; $j='1';
for($i=$start;$i<=$end;$i++){ for($i=$start;$i<=$end;$i++){
$t_units.="u".$i."=u".$i." + ".$data['t'.$j].(($j > 9) ? '' : ', ');$j++; if (!isset($t_units)) {
$t_units = '';
}
$t_units .= "u".$i."=u".$i." + ".$data['t'.$j].(($j > 9) ? '' : ', ');$j++;
} }
$q = "UPDATE ".TB_PREFIX."enforcement set $t_units where id =".(int) $check['id']; $q = "UPDATE ".TB_PREFIX."enforcement set $t_units where id =".(int) $check['id'];
$database->query($q); $database->query($q);
+1 -1
View File
@@ -4762,7 +4762,7 @@ class MYSQLi_DB implements IDbConnection {
function getVillageByName($name) { function getVillageByName($name) {
list($name) = $this->escape_input($name); list($name) = $this->escape_input($name);
$q = "SELECT wref FROM " . TB_PREFIX . "vdata where name = '$name' limit 1 LIMIT 1"; $q = "SELECT wref FROM " . TB_PREFIX . "vdata WHERE `name` = '$name' LIMIT 1";
$result = mysqli_query($this->dblink,$q); $result = mysqli_query($this->dblink,$q);
$dbarray = mysqli_fetch_array($result); $dbarray = mysqli_fetch_array($result);
return $dbarray['wref']; return $dbarray['wref'];