Кольца стакались в одном слоте потому что у них один тип.
This commit is contained in:
parent
be07b5fdec
commit
d2f793f3d1
2
main.php
2
main.php
@ -316,6 +316,7 @@ function dressitem($id)
|
|||||||
$itemInSlotQuantity = $itemInSlotRow->getNumRows();
|
$itemInSlotQuantity = $itemInSlotRow->getNumRows();
|
||||||
if ($itemInSlotQuantity) {
|
if ($itemInSlotQuantity) {
|
||||||
$itemInSlot = $itemInSlotRow->fetch_assoc();
|
$itemInSlot = $itemInSlotRow->fetch_assoc();
|
||||||
|
print_r($itemInSlot).'<br>';
|
||||||
}
|
}
|
||||||
if (in_array($selectedItem->item_type,[HELMET,ARMOR,LEGS,BOOTS,GLOVES,WEAPON,SHIELD,BELT,AMULET])) {
|
if (in_array($selectedItem->item_type,[HELMET,ARMOR,LEGS,BOOTS,GLOVES,WEAPON,SHIELD,BELT,AMULET])) {
|
||||||
//работаем с нормальными слотами
|
//работаем с нормальными слотами
|
||||||
@ -342,7 +343,6 @@ function dressitem($id)
|
|||||||
$emptyRingSlots = array_diff([9,10,11], $itemInSlot);
|
$emptyRingSlots = array_diff([9,10,11], $itemInSlot);
|
||||||
// Сортируем массив свободных слотов по возрастанию.
|
// Сортируем массив свободных слотов по возрастанию.
|
||||||
sort($emptyRingSlots);
|
sort($emptyRingSlots);
|
||||||
print_r($itemInSlot).'<br>';
|
|
||||||
print_r($emptyRingSlots);
|
print_r($emptyRingSlots);
|
||||||
// Одеваем предмет в первый свободный слот.
|
// Одеваем предмет в первый свободный слот.
|
||||||
db::c()->query('UPDATE inventory SET dressed_slot = ?i WHERE item_id = ?i',$emptyRingSlots[0], $id);
|
db::c()->query('UPDATE inventory SET dressed_slot = ?i WHERE item_id = ?i',$emptyRingSlots[0], $id);
|
||||||
|
Loading…
Reference in New Issue
Block a user