From 9805ee8044b814a23ffd337f13b3a3ca9003c787 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 8 Aug 2023 15:43:24 -0500 Subject: [PATCH] Random to utilize max + 1 --- src/engine/gameManager/LootManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index 56b19d59..c4d8f860 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -174,7 +174,7 @@ public enum LootManager { return null; if (ItemBase.getItemBase(itemUUID).getType().ordinal() == Enum.ItemType.RESOURCE.ordinal()) { - int amount = ThreadLocalRandom.current().nextInt(tableRow.maxSpawn - tableRow.minSpawn) + tableRow.minSpawn; + int amount = ThreadLocalRandom.current().nextInt(tableRow.minSpawn, tableRow.maxSpawn + 1); return new MobLoot(mob, ItemBase.getItemBase(itemUUID), amount, false); } @@ -279,7 +279,7 @@ public enum LootManager { if (inHotzone) min += mobLevel; - int roll = ThreadLocalRandom.current().nextInt(max - min) + min; + int roll = ThreadLocalRandom.current().nextInt(min, max + 1); return roll; } @@ -297,7 +297,7 @@ public enum LootManager { int high = bse.highGold; int low = bse.lowGold; - int gold = ThreadLocalRandom.current().nextInt(high - low) + low; + int gold = ThreadLocalRandom.current().nextInt(low, high + 1); if (inHotzone == true) gold = (int) (gold * HOTZONE_GOLD_RATE);