Fix non stackable items not getting moved to filtered slots first
This commit is contained in:
parent
9a1323ba46
commit
0bbe07f921
@ -1000,8 +1000,9 @@ class MatteryPlayerCapability(val ply: Player) : ICapabilityProvider, INBTSerial
|
|||||||
val exoPackContainer = exoPackContainer
|
val exoPackContainer = exoPackContainer
|
||||||
|
|
||||||
if (!stack.isStackable) {
|
if (!stack.isStackable) {
|
||||||
|
// двигаем в отфильтрованные слоты
|
||||||
for (i in items.indices) {
|
for (i in items.indices) {
|
||||||
if (items[i].isEmpty && (regularSlotFilters[i].value === null || regularSlotFilters[i].value === stack.item)) {
|
if (items[i].isEmpty && regularSlotFilters[i].value === stack.item) {
|
||||||
items[i] = stack.copy()
|
items[i] = stack.copy()
|
||||||
items[i].popTime = 5
|
items[i].popTime = 5
|
||||||
stack.count = 0
|
stack.count = 0
|
||||||
@ -1010,7 +1011,26 @@ class MatteryPlayerCapability(val ply: Player) : ICapabilityProvider, INBTSerial
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i in 0 until exoPackContainer.containerSize) {
|
for (i in 0 until exoPackContainer.containerSize) {
|
||||||
if (exoPackContainer[i].isEmpty && exoPackContainer.testSlotFilter(i, stack)) {
|
if (exoPackContainer[i].isEmpty && exoPackContainer.hasSlotFilter(i) && exoPackContainer.testSlotFilter(i, stack)) {
|
||||||
|
exoPackContainer[i] = stack.copy()
|
||||||
|
exoPackContainer[i].popTime = 5
|
||||||
|
stack.count = 0
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// двигаем в обычные слоты
|
||||||
|
for (i in items.indices) {
|
||||||
|
if (items[i].isEmpty && regularSlotFilters[i].value === null) {
|
||||||
|
items[i] = stack.copy()
|
||||||
|
items[i].popTime = 5
|
||||||
|
stack.count = 0
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i in 0 until exoPackContainer.containerSize) {
|
||||||
|
if (exoPackContainer[i].isEmpty && !exoPackContainer.hasSlotFilter(i)) {
|
||||||
exoPackContainer[i] = stack.copy()
|
exoPackContainer[i] = stack.copy()
|
||||||
exoPackContainer[i].popTime = 5
|
exoPackContainer[i].popTime = 5
|
||||||
stack.count = 0
|
stack.count = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user