Browse Source

5 second delay forced between warehouse transactions

lakebane-master
FatBoy-DOTC 8 months ago
parent
commit
d610bccdee
  1. 12
      src/engine/objects/Warehouse.java

12
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) { 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"); ChatManager.chatSystemInfo(player, "You Must Wait To Do This");
return; return;
} }
player.lastAction = System.currentTimeMillis();
Building warehouseBuilding; Building warehouseBuilding;
Warehouse warehouse; Warehouse warehouse;
@ -182,6 +183,13 @@ public class Warehouse extends AbstractWorldObject {
public static void warehouseWithdraw(MerchantMsg msg, PlayerCharacter player, NPC npc, ClientConnection origin) { 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; int withdrawAmount;
Building warehouseBuilding; Building warehouseBuilding;
Warehouse warehouse; Warehouse warehouse;

Loading…
Cancel
Save