Кольца стакались в одном слоте потому что у них один тип.

This commit is contained in:
lopar 2020-08-29 16:36:46 +03:00
parent f06f5bffe1
commit 1da89b2548

View File

@ -315,8 +315,8 @@ function dressitem($id)
$itemInSlotRow = db::c()->query('SELECT dressed_slot FROM inventory WHERE owner_id = ?i AND dressed_slot > 0 AND item_type = ?i', $_SESSION['uid'], $selectedItem->item_type);
$itemInSlotQuantity = $itemInSlotRow->getNumRows();
if ($itemInSlotQuantity) {
$itemInSlot = $itemInSlotRow->fetch_row_array();
print_r($itemInSlot).'<br>';
$itemInSlot = $itemInSlotRow->fetch_assoc();
print_r($itemInSlot['dressed_slot']).'<br>';
}
if (in_array($selectedItem->item_type,[HELMET,ARMOR,LEGS,BOOTS,GLOVES,WEAPON,SHIELD,BELT,AMULET])) {
//работаем с нормальными слотами
@ -340,7 +340,7 @@ function dressitem($id)
} elseif ($itemInSlotQuantity > 0 && $itemInSlotQuantity < 3) {
// Сравниваем массив колец и массив слотов для колец.
//FIXME Два кольца стакаются в среднем слоте!
$emptyRingSlots = array_diff([9,10,11], $itemInSlot);
$emptyRingSlots = array_diff([9,10,11], $itemInSlot['dressed_slot']);
// Сортируем массив свободных слотов по возрастанию.
sort($emptyRingSlots);
print_r($emptyRingSlots);