More item gen bug fixes with array merges and filters

This commit is contained in:
color.diff=auto 2021-05-06 04:39:37 -06:00
parent 10a2db46ad
commit 54ecb62674

View File

@ -28,8 +28,15 @@ class D2ItemData {
$x[] = $i; $x[] = $i;
} }
if(!empty($x[0])){
$invClean = array_filter($x[0]); $x[0] = array_filter($x[0]);
}
$invClean = $x[0];
if (!empty($invClean)){
$return = array_merge($res, $invClean);
} else {
$return = $res;
}
$return = array_merge($res, $invClean); $return = array_merge($res, $invClean);
} else { } else {
@ -140,7 +147,11 @@ class D2ItemData {
$baseItemInfo = PDO_FetchRow($sqlWeapons); $baseItemInfo = PDO_FetchRow($sqlWeapons);
} }
$return['baseItemInfo'] = $baseItemInfo;
if(!empty($baseItemInfo)){
$return['baseItemInfo'] = array_filter($baseItemInfo); $return['baseItemInfo'] = array_filter($baseItemInfo);
}
if(!$doc){ if(!$doc){
header('Content-Type: application/json'); header('Content-Type: application/json');