Delete char with house #149

oops, didn't mean to submit that last push, I hadn't added the empty check. (noob moment)
quick fix for #149
This commit is contained in:
Lee 2021-02-02 14:42:30 +00:00
parent 565e6e3a3d
commit a1c7c2768c

View File

@ -35,13 +35,6 @@ if(isset($_POST['deletecharactersave']) && $_POST['deletecharactersave'] == 1) {
}
}
if($db->hasColumn('houses', 'id')) {
$house = $db->query('SELECT `id` FROM `houses` WHERE `owner` = '.$player->getId());
if($house->rowCount() > 0) {
$errors[] = 'You cannot delete a character when they own a home.';
}
}
if(empty($errors) && $password_verify != $account_logged->getPassword()) {
$errors[] = 'Wrong password to account.';
}
@ -54,6 +47,13 @@ if(isset($_POST['deletecharactersave']) && $_POST['deletecharactersave'] == 1) {
$errors[] = 'This player has been already deleted.';
}
if(empty($errors) && $db->hasColumn('houses', 'id')) {
$house = $db->query('SELECT `id` FROM `houses` WHERE `owner` = '.$player->getId());
if($house->rowCount() > 0) {
$errors[] = 'You cannot delete a character when they own a home.';
}
}
if(empty($errors)) {
//dont show table "delete character" again
$show_form = false;