diff --git a/system/pages/characters.php b/system/pages/characters.php index 89f98cf0..b88368ff 100644 --- a/system/pages/characters.php +++ b/system/pages/characters.php @@ -202,36 +202,38 @@ if($player->isLoaded() && !$player->isDeleted()) unset($storage); } - if($db->hasTable('player_items') && $db->hasColumn('player_items', 'pid') && $db->hasColumn('player_items', 'sid') && $db->hasColumn('player_items', 'itemtype')) { + if ($db->hasTableAndColumns('player_items', ['pid', 'sid', 'itemtype'])) { $eq_sql = $db->query('SELECT `pid`, `itemtype` FROM player_items WHERE player_id = '.$player->getId().' AND (`pid` >= 1 and `pid` <= 10)'); - $equipment = array(); - foreach($eq_sql as $eq) + $equipment = []; + foreach($eq_sql as $eq) { $equipment[$eq['pid']] = $eq['itemtype']; + } - $empty_slots = array("", "no_helmet", "no_necklace", "no_backpack", "no_armor", "no_handleft", "no_handright", "no_legs", "no_boots", "no_ring", "no_ammo"); - for($i = 0; $i <= 10; $i++) - { + $empty_slots = ["", "no_helmet", "no_necklace", "no_backpack", "no_armor", "no_handleft", "no_handright", "no_legs", "no_boots", "no_ring", "no_ammo"]; + + for($i = 0; $i <= 10; $i++) { if(!isset($equipment[$i]) || $equipment[$i] == 0) $equipment[$i] = $empty_slots[$i]; } - for($i = 1; $i < 11; $i++) - { - if(Validator::number($equipment[$i])) + for($i = 1; $i < 11; $i++) { + if(Validator::number($equipment[$i])) { $equipment[$i] = getItemImage($equipment[$i]); - else + } + else { $equipment[$i] = ' ' . $equipment[$i] . ''; + } } - - $skulls = array( - 1 => 'yellow_skull', - 2 => 'green_skull', - 3 => 'white_skull', - 4 => 'red_skull', - 5 => 'black_skull' - ); } + $skulls = [ + 1 => 'yellow_skull', + 2 => 'green_skull', + 3 => 'white_skull', + 4 => 'red_skull', + 5 => 'black_skull', + ]; + $dead_add_content = ''; $deaths = array(); if($db->hasTable('killers')) {