stacking fix
This commit is contained in:
@@ -6,6 +6,10 @@ local state
|
|||||||
|
|
||||||
local post_auction
|
local post_auction
|
||||||
|
|
||||||
|
local DELAY = 0.5
|
||||||
|
|
||||||
|
local last_posted = GetTime()
|
||||||
|
|
||||||
function Aux.post.onupdate()
|
function Aux.post.onupdate()
|
||||||
if state then
|
if state then
|
||||||
if state.auctioning then
|
if state.auctioning then
|
||||||
@@ -21,7 +25,7 @@ function Aux.post.onupdate()
|
|||||||
state.name,
|
state.name,
|
||||||
state.stack_size,
|
state.stack_size,
|
||||||
function(slot)
|
function(slot)
|
||||||
if slot then
|
if state and slot then
|
||||||
post_auction(slot)
|
post_auction(slot)
|
||||||
else
|
else
|
||||||
Aux.post.stop()
|
Aux.post.stop()
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ local state
|
|||||||
|
|
||||||
local last_move = GetTime()
|
local last_move = GetTime()
|
||||||
|
|
||||||
|
local DELAY = 0
|
||||||
|
|
||||||
local inventory, item_slots, find_empty_slot, locked, same_slot, move_item, item_name, stack_size
|
local inventory, item_slots, find_empty_slot, locked, same_slot, move_item, item_name, stack_size
|
||||||
|
|
||||||
-- returns iterator for inventory slots
|
-- returns iterator for inventory slots
|
||||||
@@ -68,12 +70,18 @@ function move_item(from_slot, to_slot, amount)
|
|||||||
|
|
||||||
amount = min(max_stack(from_slot) - stack_size(to_slot), amount)
|
amount = min(max_stack(from_slot) - stack_size(to_slot), amount)
|
||||||
|
|
||||||
state.processing = 3
|
if stack_size(to_slot) == 0 then
|
||||||
|
state.processing = 4
|
||||||
|
else
|
||||||
|
state.processing = 3
|
||||||
|
end
|
||||||
|
if CursorHasItem() then
|
||||||
|
state.processing = state.processing + 1
|
||||||
|
ClearCursor()
|
||||||
|
end
|
||||||
|
|
||||||
ClearCursor()
|
|
||||||
SplitContainerItem(from_slot.bag, from_slot.bag_slot, amount)
|
SplitContainerItem(from_slot.bag, from_slot.bag_slot, amount)
|
||||||
PickupContainerItem(to_slot.bag, to_slot.bag_slot)
|
PickupContainerItem(to_slot.bag, to_slot.bag_slot)
|
||||||
ClearCursor()
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -103,7 +111,7 @@ function item_charges(slot)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Aux.stack.onupdate()
|
function Aux.stack.onupdate()
|
||||||
if state and state.processing <= 0 and GetTime() - last_move > 0.3 then
|
if state and state.processing <= 0 and GetTime() - last_move > DELAY then
|
||||||
local empty_slot = find_empty_slot()
|
local empty_slot = find_empty_slot()
|
||||||
|
|
||||||
if empty_slot and stack_size(state.target_slot) > state.target_size then
|
if empty_slot and stack_size(state.target_slot) > state.target_size then
|
||||||
|
|||||||
Reference in New Issue
Block a user