mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 09:19:22 +02:00
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:
parent
565e6e3a3d
commit
a1c7c2768c
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user