use empty slot first when splitting stacks if available
This commit is contained in:
@@ -108,7 +108,14 @@ function Aux.stack.onupdate()
|
|||||||
local next_slot = state.other_slots()
|
local next_slot = state.other_slots()
|
||||||
local empty_slot = find_empty_slot()
|
local empty_slot = find_empty_slot()
|
||||||
|
|
||||||
if next_slot then
|
if empty_slot and stack_size(state.target_slot) > state.target_size then
|
||||||
|
move_item(
|
||||||
|
state.target_slot,
|
||||||
|
empty_slot,
|
||||||
|
stack_size(state.target_slot) - state.target_size
|
||||||
|
)
|
||||||
|
return
|
||||||
|
elseif next_slot then
|
||||||
if stack_size(state.target_slot) < state.target_size then
|
if stack_size(state.target_slot) < state.target_size then
|
||||||
move_item(
|
move_item(
|
||||||
next_slot,
|
next_slot,
|
||||||
@@ -124,13 +131,6 @@ function Aux.stack.onupdate()
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
elseif empty_slot and stack_size(state.target_slot) > state.target_size then
|
|
||||||
move_item(
|
|
||||||
state.target_slot,
|
|
||||||
empty_slot,
|
|
||||||
stack_size(state.target_slot) - state.target_size
|
|
||||||
)
|
|
||||||
return
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Aux.stack.stop()
|
Aux.stack.stop()
|
||||||
|
|||||||
Reference in New Issue
Block a user