mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-21 20:16:11 +00:00
Fixed #448
+Fixed a bug that created the admin village in a not existent cell, if the world was smaller than 50x50
This commit is contained in:
@@ -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));
|
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);
|
$uid = mysqli_insert_id($database->dblink);
|
||||||
$admin_village_created = false;
|
$admin_village_created = false;
|
||||||
$xcoor = 50;
|
$xcoor = round(WORLD_MAX / 2);
|
||||||
$addUnitsWrefs = [];
|
$addUnitsWrefs = [];
|
||||||
$addTechWrefs = [];
|
$addTechWrefs = [];
|
||||||
$addABTechWrefs = [];
|
$addABTechWrefs = [];
|
||||||
|
|
||||||
while (!$admin_village_created) {
|
while (!$admin_village_created) {
|
||||||
$wid = $admin->getWref($xcoor++, 50);
|
$wid = $admin->getWref($xcoor++, round(WORLD_MAX / 2));
|
||||||
$status = $database->getVillageState($wid);
|
$status = $database->getVillageState($wid);
|
||||||
if($status == 0) {
|
if($status == 0) {
|
||||||
$database->setFieldTaken($wid);
|
$database->setFieldTaken($wid);
|
||||||
|
|||||||
Reference in New Issue
Block a user