mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 09:49:22 +02:00
Fix delete character exception
This commit is contained in:
parent
647eae08b4
commit
9f3231fff6
@ -61,16 +61,18 @@ if(isset($_POST['deletecharactersave']) && $_POST['deletecharactersave'] == 1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(empty($errors)) {
|
||||||
$ownerid = 'ownerid';
|
$ownerid = 'ownerid';
|
||||||
if($db->hasColumn('guilds', 'owner_id'))
|
if ($db->hasColumn('guilds', 'owner_id'))
|
||||||
$ownerid = 'owner_id';
|
$ownerid = 'owner_id';
|
||||||
$guild = $db->query('SELECT `name` FROM `guilds` WHERE `' . $ownerid . '` = '.$player->getId());
|
$guild = $db->query('SELECT `name` FROM `guilds` WHERE `' . $ownerid . '` = ' . $player->getId());
|
||||||
if($guild->rowCount() > 0) {
|
if ($guild->rowCount() > 0) {
|
||||||
$errors[] = 'You cannot delete a character when they own a guild.';
|
$errors[] = 'You cannot delete a character when they own a guild.';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(empty($errors)) {
|
if(empty($errors)) {
|
||||||
//dont show table "delete character" again
|
// don't show table "delete character" again
|
||||||
$show_form = false;
|
$show_form = false;
|
||||||
/** @var OTS_DB_MySQL $db */
|
/** @var OTS_DB_MySQL $db */
|
||||||
if ($db->hasColumn('players', 'deletion'))
|
if ($db->hasColumn('players', 'deletion'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user