Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Bug: Fix AutoFill not working when core is full #15

Closed
kubikaugustyn opened this issue Feb 18, 2023 · 1 comment
Closed

Bug: Fix AutoFill not working when core is full #15

kubikaugustyn opened this issue Feb 18, 2023 · 1 comment

Comments

@kubikaugustyn
Copy link

Your autofill drops items like that:
auto-fill.js:38

if (stack.amount) {
    Call.transferInventory(player, core);
} else {
    Call.requestItem(player, core, request, 999);
}

But when core is full of for example copper, it can't return the copper in your drone's inventory to core.

// Actually Java code, but JS syntax looks better
if (stack.amount > 0) {
    Call.transferInventory(player, core);
    if (stack.amount > 0) { // Throw out items, that core doesn't accept
        Call.dropItem(0F);
    }
} else {
    Call.requestItem(player, core, request.get(), 999);
}

My java version drops items that don't fit to core

@kubikaugustyn
Copy link
Author

And with inventory full of copper, you can't fill turrets etc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant