diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java index a58cd128bf..eb732c3b2c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java @@ -27,6 +27,7 @@ package net.runelite.client.plugins.loottracker; import com.google.common.collect.HashMultiset; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; import com.google.common.collect.Multiset; import com.google.common.collect.Multisets; import com.google.inject.Provides; @@ -87,6 +88,7 @@ import net.runelite.http.api.loottracker.GameItem; import net.runelite.http.api.loottracker.LootRecord; import net.runelite.http.api.loottracker.LootRecordType; import net.runelite.http.api.loottracker.LootTrackerClient; +import org.apache.commons.lang3.ArrayUtils; @PluginDescriptor( name = "Loot Tracker", @@ -120,6 +122,9 @@ public class LootTrackerPlugin extends Plugin 13113, "Larran's small chest" ); + // Last man standing map regions + private static final Set LAST_MAN_STANDING_REGIONS = ImmutableSet.of(13658, 13659, 13914, 13915, 13916); + @Inject private ClientToolbar clientToolbar; @@ -322,6 +327,12 @@ public class LootTrackerPlugin extends Plugin @Subscribe public void onPlayerLootReceived(final PlayerLootReceived playerLootReceived) { + // Ignore Last Man Standing player loots + if (isAtLMS()) + { + return; + } + final Player player = playerLootReceived.getPlayer(); final Collection items = playerLootReceived.getItems(); final String name = player.getName(); @@ -590,4 +601,22 @@ public class LootTrackerPlugin extends Plugin return trackerRecords; } + + /** + * Is player at the Last Man Standing minigame + */ + private boolean isAtLMS() + { + final int[] mapRegions = client.getMapRegions(); + + for (int region : LAST_MAN_STANDING_REGIONS) + { + if (ArrayUtils.contains(mapRegions, region)) + { + return true; + } + } + + return false; + } }