diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodePlugin.java index 72dd25c268..f20faca83d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodePlugin.java @@ -87,6 +87,8 @@ public class MotherlodePlugin extends Plugin ItemID.MITHRIL_ORE, ItemID.GOLD_ORE, ItemID.COAL, ItemID.GOLDEN_NUGGET); private static final Set ROCK_OBSTACLES = ImmutableSet.of(ROCKFALL, ROCKFALL_26680); + private static final int MAX_INVENTORY_SIZE = 28; + private static final int SACK_LARGE_SIZE = 162; private static final int SACK_SIZE = 81; @@ -359,13 +361,18 @@ public class MotherlodePlugin extends Plugin { inMlm = checkInMlm(); } + else if (event.getGameState() == GameState.LOGIN_SCREEN) + { + // Prevent code from running while logged out. + inMlm = false; + } } private Integer calculateDepositsLeft() { if (maxSackSize == 0) // check if maxSackSize has been initialized { - return null; + refreshSackValues(); } double depositsLeft = 0; @@ -380,8 +387,6 @@ public class MotherlodePlugin extends Plugin Item[] result = inventory.getItems(); assert result != null; - int inventorySize = result.length; - for (Item item : result) { // Assume that MLM ores are being banked and exclude them from the check, @@ -394,7 +399,7 @@ public class MotherlodePlugin extends Plugin } } - double inventorySpace = inventorySize - nonPayDirtItems; + double inventorySpace = MAX_INVENTORY_SIZE - nonPayDirtItems; double sackSizeRemaining = maxSackSize - curSackSize; if (inventorySpace > 0 && sackSizeRemaining > 0)