From 50f81396c772426c515dafb7f0ac0eaf06ae405d Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 21 Aug 2023 14:01:28 -0400 Subject: [PATCH] Cleanup of PERSIST db call. --- src/engine/db/handlers/dbNPCHandler.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/engine/db/handlers/dbNPCHandler.java b/src/engine/db/handlers/dbNPCHandler.java index ae6a027f..51b20246 100644 --- a/src/engine/db/handlers/dbNPCHandler.java +++ b/src/engine/db/handlers/dbNPCHandler.java @@ -57,10 +57,7 @@ public class dbNPCHandler extends dbHandlerBase { preparedStatement.setFloat(9, toAdd.buyPercent); preparedStatement.setFloat(10, toAdd.sellPercent); - if (toAdd.buildingUUID > 0) - preparedStatement.setInt(11, toAdd.buildingUUID); - else - preparedStatement.setInt(11, 0); + preparedStatement.setInt(11, Math.max(toAdd.buildingUUID, 0)); ResultSet rs = preparedStatement.executeQuery();