From d610bccdee15e0b4ff749754c50cb189e67d625f Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 15 May 2024 16:46:00 -0500 Subject: [PATCH] 5 second delay forced between warehouse transactions --- src/engine/objects/Warehouse.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/engine/objects/Warehouse.java b/src/engine/objects/Warehouse.java index bf8ee055..9c17c39f 100644 --- a/src/engine/objects/Warehouse.java +++ b/src/engine/objects/Warehouse.java @@ -129,11 +129,12 @@ public class Warehouse extends AbstractWorldObject { public static void warehouseDeposit(MerchantMsg msg, PlayerCharacter player, NPC npc, ClientConnection origin) { - if(player.lastAction + 5000 > System.currentTimeMillis()){ + long nextAllowedAction = player.lastAction + 5000; + if(nextAllowedAction > System.currentTimeMillis()){ ChatManager.chatSystemInfo(player, "You Must Wait To Do This"); return; } - + player.lastAction = System.currentTimeMillis(); Building warehouseBuilding; Warehouse warehouse; @@ -182,6 +183,13 @@ public class Warehouse extends AbstractWorldObject { public static void warehouseWithdraw(MerchantMsg msg, PlayerCharacter player, NPC npc, ClientConnection origin) { + long nextAllowedAction = player.lastAction + 5000; + if(nextAllowedAction > System.currentTimeMillis()){ + ChatManager.chatSystemInfo(player, "You Must Wait To Do This"); + return; + } + player.lastAction = System.currentTimeMillis(); + int withdrawAmount; Building warehouseBuilding; Warehouse warehouse;