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 aab62fb724
commit 24ff5684cd
12 changed files with 51 additions and 20 deletions

View File

@@ -61,6 +61,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;