Skip to content

Commit

Permalink
ground items: fix only show only loot test
Browse files Browse the repository at this point in the history
This restores the previous behavior of not showing unowned items (even though you can pick them up), and fixes marking items as group-owned for non gims
  • Loading branch information
Adam- committed May 13, 2024
1 parent 15b0dc5 commit b2365eb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ int getGePrice()

boolean isMine()
{
return ownership != OWNERSHIP_OTHER;
return ownership == OWNERSHIP_SELF || ownership == OWNERSHIP_GROUP;
}

void reset()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import net.runelite.api.MenuEntry;
import net.runelite.api.Tile;
import net.runelite.api.TileItem;
import net.runelite.api.Varbits;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.ClientTick;
import net.runelite.api.events.FocusChanged;
Expand Down Expand Up @@ -387,6 +388,16 @@ private GroundItem buildGroundItem(final Tile tile, final TileItem item)
final int alchPrice = itemComposition.getHaPrice();
final int despawnTime = item.getDespawnTime() - client.getTickCount();
final int visibleTime = item.getVisibleTime() - client.getTickCount();
int ownership = item.getOwnership();
final int accountType = client.getVarbitValue(Varbits.ACCOUNT_TYPE);
boolean isGim = accountType >= 4 && accountType <= 6; // ~is_group_iron

// from ~script7240
if (ownership == TileItem.OWNERSHIP_GROUP && !isGim)
{
// non-gims see loot from other people as "group" loop since they are both group -1.
ownership = TileItem.OWNERSHIP_OTHER;
}

final GroundItem groundItem = GroundItem.builder()
.id(itemId)
Expand All @@ -397,7 +408,7 @@ private GroundItem buildGroundItem(final Tile tile, final TileItem item)
.haPrice(alchPrice)
.height(tile.getItemLayer().getHeight())
.tradeable(itemComposition.isTradeable())
.ownership(item.getOwnership())
.ownership(ownership)
.isPrivate(item.isPrivate())
.spawnTime(Instant.now())
.stackable(itemComposition.isStackable())
Expand Down

0 comments on commit b2365eb

Please sign in to comment.