From b7c2b7a0d529bb88dc254ceb4111adf9a756fc4c Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 25 Jan 2025 14:27:25 -0600 Subject: [PATCH] PlayerCombatStats dex penalty applied correctly --- src/engine/db/handlers/dbItemBaseHandler.java | 6 +++--- src/engine/objects/PlayerCombatStats.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/db/handlers/dbItemBaseHandler.java b/src/engine/db/handlers/dbItemBaseHandler.java index 728aa1b4..2bada267 100644 --- a/src/engine/db/handlers/dbItemBaseHandler.java +++ b/src/engine/db/handlers/dbItemBaseHandler.java @@ -52,10 +52,10 @@ public class dbItemBaseHandler extends dbHandlerBase { preparedStatement.setInt(1, itemBase.getUUID()); ResultSet rs = preparedStatement.executeQuery(); - try { + + // Check if a result was found + if (rs.next()) { itemBase.dexReduction = rs.getFloat("item_bulk_factor"); - }catch(Exception e){ - Logger.error("No Value Found For Dex Penalty FOr Item: " + itemBase.getUUID()); } } catch (SQLException e) { diff --git a/src/engine/objects/PlayerCombatStats.java b/src/engine/objects/PlayerCombatStats.java index d404aae1..05c33739 100644 --- a/src/engine/objects/PlayerCombatStats.java +++ b/src/engine/objects/PlayerCombatStats.java @@ -687,7 +687,7 @@ public class PlayerCombatStats { if(penaltyFactor > 0) penaltyFactor *= 0.01f; - float totalPenalty = dex * (1 + penaltyFactor); + float totalPenalty = dex * penaltyFactor; return Math.round(dex - totalPenalty);