From ca0ba2e8f11a2de86ff1d2c6046ee79fd2ec06b6 Mon Sep 17 00:00:00 2001 From: iopietro Date: Wed, 25 Jul 2018 18:44:57 +0200 Subject: [PATCH] Fixed #448 +Fixed a bug that created the admin village in a not existent cell, if the world was smaller than 50x50 --- install/include/accounts.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/include/accounts.php b/install/include/accounts.php index 5580465a..4abf1eff 100644 --- a/install/include/accounts.php +++ b/install/include/accounts.php @@ -52,13 +52,13 @@ mysqli_query($database->dblink, "INSERT INTO " . TB_PREFIX . "users SET username = '".$database->escape($_POST['aname'])."', password = '" . password_hash($_POST['apass'], PASSWORD_BCRYPT, ['cost' => 12]) . "', email = '".$database->escape($_POST['aemail'])."', tribe = ".(int) $_POST['atribe'].", access = 9, is_bcrypt = 1") OR DIE (mysqli_error($database->dblink)); $uid = mysqli_insert_id($database->dblink); $admin_village_created = false; - $xcoor = 50; + $xcoor = round(WORLD_MAX / 2); $addUnitsWrefs = []; $addTechWrefs = []; $addABTechWrefs = []; while (!$admin_village_created) { - $wid = $admin->getWref($xcoor++, 50); + $wid = $admin->getWref($xcoor++, round(WORLD_MAX / 2)); $status = $database->getVillageState($wid); if($status == 0) { $database->setFieldTaken($wid);