Fix #345 - Character Auction storage account

When storage_account_id is not configured in config.php and people want to try the character auction system
Give them an error message instead of a query crash. Telling them to edit config.php properly.
This commit is contained in:
Znote
2019-03-18 01:53:38 +01:00
parent 63357290a0
commit 7eebbde59e
2 changed files with 15 additions and 4 deletions

View File

@@ -483,9 +483,20 @@ if ($auction['characterAuction']) {
AND `p`.`group_id` = 1
LIMIT 1
;");
if (isset($player['online']) && $player['online'] == 0) {
if (isset($player['alreadyInAuction']) && $player['alreadyInAuction'] == 0) {
$status = true;
// Verify storage account ID exist
$storage_account = mysql_select_single("
SELECT `id`
FROM `accounts`
WHERE `id`={$auction['storage_account_id']}
LIMIT 1;
");
if ($storage_account === false) {
data_dump($auction, false, "Configured storage_account_id in config.php does not exist!");
} else {
if (isset($player['online']) && $player['online'] == 0) {
if (isset($player['alreadyInAuction']) && $player['alreadyInAuction'] == 0) {
$status = true;
}
}
}
}