More changes to deleted characters (Account, guilds)

Account: Cannot change name, comment, gender
+ Cannot be deleted if owns a guild
Guilds: Cannot create, cannot be invited, cannot accept invite, cannot be passed leadership to
This commit is contained in:
slawkens
2023-06-27 17:41:04 +02:00
parent ab964fa1de
commit 3732bf988d
12 changed files with 53 additions and 22 deletions

View File

@@ -31,6 +31,14 @@ if(isset($_POST['deletecharactersave']) && $_POST['deletecharactersave'] == 1) {
}
}
$ownerid = 'ownerid';
if($db->hasColumn('guilds', 'owner_id'))
$ownerid = 'owner_id';
$guild = $db->query('SELECT `name` FROM `guilds` WHERE `' . $ownerid . '` = '.$player->getId());
if($guild->rowCount() > 0) {
$errors[] = 'You cannot delete a character when they own a guild.';
}
if(empty($errors)) {
//dont show table "delete character" again
$show_form = false;