From a7e953ac20f0f37ba47531dc997429b3dee6e9bb Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 23 Apr 2024 12:41:10 -0400 Subject: [PATCH] Rebuild of ./createitem --- src/engine/devcmd/cmds/CreateItemCmd.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/engine/devcmd/cmds/CreateItemCmd.java b/src/engine/devcmd/cmds/CreateItemCmd.java index 4e2d0b87..d934c6d4 100644 --- a/src/engine/devcmd/cmds/CreateItemCmd.java +++ b/src/engine/devcmd/cmds/CreateItemCmd.java @@ -31,7 +31,6 @@ public class CreateItemCmd extends AbstractDevCmd { @Override protected void _doCmd(PlayerCharacter playerCharacter, String[] words, AbstractGameObject target) { - boolean worked = false; if (words.length < 2) { this.sendUsage(playerCharacter); @@ -43,7 +42,6 @@ public class CreateItemCmd extends AbstractDevCmd { if (template == null) return; - ; int size = 1; @@ -51,7 +49,6 @@ public class CreateItemCmd extends AbstractDevCmd { size = Integer.parseInt(words[1]); for (int i = 0; i < size; i++) { - worked = false; if (!playerCharacter.charItemManager.hasRoomInventory(template.item_wt)) { ChatManager.chatSystemInfo(playerCharacter, "You can not carry any more of that item."); @@ -65,13 +62,10 @@ public class CreateItemCmd extends AbstractDevCmd { try { item = DbManager.ItemQueries.PERSIST(item); - worked = true; + playerCharacter.charItemManager.addItemToInventory(item); } catch (Exception e) { Logger.error(e); } - if (worked) { - playerCharacter.charItemManager.addItemToInventory(item); - } } playerCharacter.charItemManager.updateInventory(); }