Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

Commit

Permalink
Fix Grand Exchange item selling, when item is stackable
Browse files Browse the repository at this point in the history
  • Loading branch information
Explv authored and Explv committed Jan 27, 2019
1 parent c31132a commit a4cf88d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ public class GESellActivity extends GEActivity {
public GESellActivity(final GEItem geItem) {
this.geItem = geItem;
depositAllBanking = new DepositAllBanking();
itemReqBanking = new ItemReqBanking(new ItemReq(geItem.getName(), 1, geItem.getQuantity()).setNoted());
itemReqBanking = new ItemReqBanking(
new ItemReq(geItem.getName(), 1, geItem.getQuantity()).setStackable().setNoted()
);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion AIO/src/org/aio/script/AIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@ScriptManifest(author = "Explv", name = "Explv's AIO " + AIO.VERSION, info = "AIO", version = 0, logo = "http://i.imgur.com/58Zz0fb.png")
public class AIO extends Script {

static final String VERSION = "v2.1.0";
static final String VERSION = "v2.1.1";

private Gui gui;
private Paint paint;
Expand Down
9 changes: 7 additions & 2 deletions AIO/src/org/aio/util/item_requirement/ItemReq.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ public final ItemReq setEquipable() {
}

public final boolean isRequirementItem(final Item item) {
return item.getName().equals(getName()) && item.isNote() == isNoted();
return item.getName().equals(getName()) &&
(item.isNote() == isNoted()) || (isStackable() && item.getDefinition().getNotedId() == -1);
}

public final boolean hasRequirement(final ItemContainer... itemContainers) {
Expand All @@ -114,7 +115,11 @@ public final long getAmount(final ItemContainer... itemContainers) {
.mapToLong(itemContainer ->
itemContainer.getAmount(item ->
item.getName().equals(getName()) &&
(itemContainer instanceof Bank || item.isNote() == isNoted())
(
itemContainer instanceof Bank ||
item.isNote() == isNoted() ||
(isStackable() && item.getDefinition().getNotedId() == -1) // If an item is stackable, it's noted ID will be -1
)
)
).sum();
}
Expand Down

0 comments on commit a4cf88d

Please sign in to comment.