Browse Source

PlayerCombatStats dex penalty applied correctly

lakebane-dex-penalty
FatBoy-DOTC 5 days ago
parent
commit
b7c2b7a0d5
  1. 6
      src/engine/db/handlers/dbItemBaseHandler.java
  2. 2
      src/engine/objects/PlayerCombatStats.java

6
src/engine/db/handlers/dbItemBaseHandler.java

@ -52,10 +52,10 @@ public class dbItemBaseHandler extends dbHandlerBase {
preparedStatement.setInt(1, itemBase.getUUID()); preparedStatement.setInt(1, itemBase.getUUID());
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
try {
// Check if a result was found
if (rs.next()) {
itemBase.dexReduction = rs.getFloat("item_bulk_factor"); 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) { } catch (SQLException e) {

2
src/engine/objects/PlayerCombatStats.java

@ -687,7 +687,7 @@ public class PlayerCombatStats {
if(penaltyFactor > 0) if(penaltyFactor > 0)
penaltyFactor *= 0.01f; penaltyFactor *= 0.01f;
float totalPenalty = dex * (1 + penaltyFactor); float totalPenalty = dex * penaltyFactor;
return Math.round(dex - totalPenalty); return Math.round(dex - totalPenalty);

Loading…
Cancel
Save