From 9efbe9ffd9ae087e2225bb8579434a020e1a744b Mon Sep 17 00:00:00 2001 From: iopietro Date: Fri, 15 Jun 2018 02:31:37 +0200 Subject: [PATCH] General fixes +Fixed a bug that didn't permit to create users' villages in small maps, from the admin panel --- GameEngine/Admin/Mods/addUsers.php | 2 +- GameEngine/Database.php | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/GameEngine/Admin/Mods/addUsers.php b/GameEngine/Admin/Mods/addUsers.php index b5124ad7..32382fd3 100755 --- a/GameEngine/Admin/Mods/addUsers.php +++ b/GameEngine/Admin/Mods/addUsers.php @@ -135,7 +135,7 @@ WHERE id = ".(int) $uid) or die(mysqli_error($database->dblink)); } $database->updateUserField($uid,"act","",1); - $wid = $database->generateBase($kid,0,false); + $wid = $database->generateBase($kid); $database->setFieldTaken($wid); //calculate random generate value and level building diff --git a/GameEngine/Database.php b/GameEngine/Database.php index 0c6f8e8a..7e5fca93 100755 --- a/GameEngine/Database.php +++ b/GameEngine/Database.php @@ -1288,17 +1288,17 @@ class MYSQLi_DB implements IDbConnection { } switch($sector){ - case 1: - $q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x < -$wide1 and x > -$wide2) and (y > $wide1 and y < $wide2) and occupied = 0"; //x- y+ - break; - case 2: - $q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x > $wide1 and x < $wide2) and (y > $wide1 and y < $wide2) and occupied = 0"; //x+ y+ - break; - case 3: - $q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x < -$wide1 and x > -$wide2) and (y < -$wide1 and y > -$wide2) and occupied = 0"; //x- y- - break; - default: - $q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x > $wide1 and x < $wide2) and (y < -$wide1 and y > -$wide2) and occupied = 0"; //x+ y- + case 1: + $q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x < -$wide1 and x > -$wide2) and (y > $wide1 and y < $wide2) and occupied = 0"; //x- y+ + break; + case 2: + $q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x > $wide1 and x < $wide2) and (y > $wide1 and y < $wide2) and occupied = 0"; //x+ y+ + break; + case 3: + $q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x < -$wide1 and x > -$wide2) and (y < -$wide1 and y > -$wide2) and occupied = 0"; //x- y- + break; + default: + $q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x > $wide1 and x < $wide2) and (y < -$wide1 and y > -$wide2) and occupied = 0"; //x+ y- } $result = mysqli_query($this->dblink,$q);