Browse Source

Rebuild of ./createitem

combat-2
MagicBot 7 months ago
parent
commit
a7e953ac20
  1. 8
      src/engine/devcmd/cmds/CreateItemCmd.java

8
src/engine/devcmd/cmds/CreateItemCmd.java

@ -31,7 +31,6 @@ public class CreateItemCmd extends AbstractDevCmd { @@ -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 { @@ -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 { @@ -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 { @@ -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();
}

Loading…
Cancel
Save