From aa116b788d86c42b67285d0714e2aa2641a75fef Mon Sep 17 00:00:00 2001 From: TiagoFar78 Date: Thu, 18 Jul 2024 22:03:26 +0100 Subject: [PATCH] fixed small bugs --- src/main/java/net/tiagofar78/prisonescape/game/Guard.java | 7 ++++++- .../game/prisonbuilding/placeables/Camera.java | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/tiagofar78/prisonescape/game/Guard.java b/src/main/java/net/tiagofar78/prisonescape/game/Guard.java index 186e61d..e7eda5c 100644 --- a/src/main/java/net/tiagofar78/prisonescape/game/Guard.java +++ b/src/main/java/net/tiagofar78/prisonescape/game/Guard.java @@ -90,7 +90,12 @@ private boolean canBuyItem(Buyable item) { return true; } - return _itemsBought.get(item.getClass().getSimpleName()) < item.getLimit(); + Integer bought = _itemsBought.get(item.getClass().getSimpleName()); + if (bought == null) { + bought = 0; + } + + return bought < item.getLimit(); } private void updateItemCount(String itemName, int amount) { diff --git a/src/main/java/net/tiagofar78/prisonescape/game/prisonbuilding/placeables/Camera.java b/src/main/java/net/tiagofar78/prisonescape/game/prisonbuilding/placeables/Camera.java index 5eb7143..a1dde6e 100644 --- a/src/main/java/net/tiagofar78/prisonescape/game/prisonbuilding/placeables/Camera.java +++ b/src/main/java/net/tiagofar78/prisonescape/game/prisonbuilding/placeables/Camera.java @@ -15,7 +15,7 @@ public class Camera { - private static final int WATCH_CAMERA_DELAY = 3; + private static final int WATCH_CAMERA_DELAY = 10; private NPC _camera;