diff --git a/functions.php b/functions.php index 1a74cdf..66af9a1 100644 --- a/functions.php +++ b/functions.php @@ -1644,16 +1644,22 @@ function setHP($hp, $maxhp) function echoscroll($slot) { global $user; + if ($user['battle']) { $script = 'fbattle'; } else { $script = 'main'; } - if ($user['battle'] > 0) $bat = db::c()->query('SELECT `id`, `magic` FROM `battle` WHERE `id` = ?i', $user['battle'])->fetch_assoc(); - $all_magic = unserialize($bat['magic']); + $all_magic = 0; + if ($user['battle'] > 0) { + $bat = db::c()->query('SELECT `magic` FROM `battle` WHERE `id` = ?i', $user['battle'])->fetch_assoc(); + $all_magic = unserialize($bat['magic']); + } + $dress = db::c()->query('SELECT `id`, `magic`, `name`, `img`, `duration`, `maxdur` FROM `inventory` WHERE `id` = ?i', $user[$slot])->fetch_assoc(); $need_charge = db::c()->query('SELECT `needcharge` FROM `magic` WHERE `id` = ?i', $dress['magic'])->fetch_assoc(); + if (($user[$slot] > 0) && ($all_magic[$user['id']] < 1 || $need_charge['needcharge'] == 0)) { $row['id'] = $user[$slot]; if ($dress['magic']) { @@ -2566,14 +2572,14 @@ function showpersout($pas = 0) // echo "