Rebuild of ./createitem
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user