From 74e97fb4357b5da37273e6c4b11617288f58efe4 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 14 Apr 2024 12:41:16 -0400 Subject: [PATCH] Minor cleanup --- src/engine/gameManager/LootManager.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index c3bd0151..aa31e0bc 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -212,7 +212,7 @@ public enum LootManager { int prefixTableRoll = 0; - if (mob.getObjectType().ordinal() == 52) + if (mob.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) prefixTableRoll = ThreadLocalRandom.current().nextInt(1, 320 + 1); else prefixTableRoll = TableRoll(mob.level, inHotzone); @@ -222,7 +222,7 @@ public enum LootManager { if (prefixMod == null) return inItem; - if (prefixMod.action.length() > 0) { + if (prefixMod.action.isEmpty() == false) { inItem.setPrefix(prefixMod.action); inItem.addPermanentEnchantment(prefixMod.action, 0, prefixMod.level, true); } @@ -246,7 +246,7 @@ public enum LootManager { int suffixTableRoll; - if (mob.getObjectType().ordinal() == 52) + if (mob.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) suffixTableRoll = ThreadLocalRandom.current().nextInt(1, 320 + 1); else suffixTableRoll = TableRoll(mob.level, inHotzone); @@ -256,7 +256,7 @@ public enum LootManager { if (suffixMod == null) return inItem; - if (suffixMod.action.length() > 0) { + if (suffixMod.action.isEmpty() == false) { inItem.setSuffix(suffixMod.action); inItem.addPermanentEnchantment(suffixMod.action, 0, suffixMod.level, false); } @@ -270,14 +270,10 @@ public enum LootManager { mobLevel = 65; int max = (int) (4.882 * mobLevel + 127.0); - - if (max > 319) - max = 319; - int min = (int) (4.469 * mobLevel - 3.469); - if (min < 70) - min = 70; + min = Math.max(min, 70); + max = Math.min(max, 319); if (inHotzone) min += mobLevel;