Кольца стакались в одном слоте потому что у них один тип.
This commit is contained in:
parent
413fe5355f
commit
6ddea96b47
2
main.php
2
main.php
@ -338,9 +338,11 @@ function dressitem($id)
|
|||||||
db::c()->query('UPDATE inventory SET dressed_slot = 9 WHERE item_id = ?i', $id);
|
db::c()->query('UPDATE inventory SET dressed_slot = 9 WHERE item_id = ?i', $id);
|
||||||
} elseif ($itemInSlotQuantity > 0 && $itemInSlotQuantity < 3) {
|
} elseif ($itemInSlotQuantity > 0 && $itemInSlotQuantity < 3) {
|
||||||
// Сравниваем массив колец и массив слотов для колец.
|
// Сравниваем массив колец и массив слотов для колец.
|
||||||
|
//FIXME Два кольца стакаются в среднем слоте!
|
||||||
$emptyRingSlots = array_diff([9,10,11], $itemInSlot);
|
$emptyRingSlots = array_diff([9,10,11], $itemInSlot);
|
||||||
// Сортируем массив свободных слотов по возрастанию.
|
// Сортируем массив свободных слотов по возрастанию.
|
||||||
sort($emptyRingSlots);
|
sort($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);
|
||||||
} elseif ($itemInSlotQuantity === 3) {
|
} elseif ($itemInSlotQuantity === 3) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user