mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
Delete char with house #149
Patch to stop players deleting themselves if they have a house Fixes #149
This commit is contained in:
parent
855e9aa3b9
commit
565e6e3a3d
@ -35,6 +35,13 @@ 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.';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user