diff --git a/system/libs/CreateCharacter.php b/system/libs/CreateCharacter.php index 87815753..65653b81 100644 --- a/system/libs/CreateCharacter.php +++ b/system/libs/CreateCharacter.php @@ -252,10 +252,12 @@ class CreateCharacter } } - $loaded_items_to_copy = $db->query("SELECT * FROM player_items WHERE player_id = ".$char_to_copy->getId().""); - foreach($loaded_items_to_copy as $save_item) { - $blob = $db->quote($save_item['attributes']); - $db->query("INSERT INTO `player_items` (`player_id` ,`pid` ,`sid` ,`itemtype`, `count`, `attributes`) VALUES ('".$player->getId()."', '".$save_item['pid']."', '".$save_item['sid']."', '".$save_item['itemtype']."', '".$save_item['count']."', $blob);"); + if ($db->hasTable('player_items') && $db->hasColumn('player_items', 'pid') && $db->hasColumn('player_items', 'sid') && $db->hasColumn('player_items', 'itemtype')) { + $loaded_items_to_copy = $db->query("SELECT * FROM player_items WHERE player_id = ".$char_to_copy->getId().""); + foreach($loaded_items_to_copy as $save_item) { + $blob = $db->quote($save_item['attributes']); + $db->query("INSERT INTO `player_items` (`player_id` ,`pid` ,`sid` ,`itemtype`, `count`, `attributes`) VALUES ('".$player->getId()."', '".$save_item['pid']."', '".$save_item['sid']."', '".$save_item['itemtype']."', '".$save_item['count']."', $blob);"); + } } global $twig; diff --git a/system/pages/characters.php b/system/pages/characters.php index 2da87845..393847fb 100644 --- a/system/pages/characters.php +++ b/system/pages/characters.php @@ -201,9 +201,7 @@ if($player->isLoaded() && !$player->isDeleted()) unset($storage); } - if($config['characters']['equipment']) - { - global $db; + if($config['characters']['equipment'] && $db->hasTable('player_items') && $db->hasColumn('player_items', 'pid') && $db->hasColumn('player_items', 'sid') && $db->hasColumn('player_items', '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)