From 2580b6ed2b099f666d2cf2315857aca9d66c6b6e Mon Sep 17 00:00:00 2001 From: Major- Date: Sun, 23 Feb 2014 04:10:26 +0000 Subject: [PATCH] Fix ::item and ::remove commands. --- data/plugins/cmd-item/item.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data/plugins/cmd-item/item.rb b/data/plugins/cmd-item/item.rb index 59fee83a..76dc8498 100644 --- a/data/plugins/cmd-item/item.rb +++ b/data/plugins/cmd-item/item.rb @@ -10,7 +10,8 @@ on :command, :item, RIGHTS_ADMIN do |player, command| next end - id = args[0].to_i, amount = args.length == 2 ? args[1].to_i : 1 + id = args[0].to_i + amount = args.length == 2 ? args[1].to_i : 1 if (id < 0 || id >= ItemDefinition.count) player.send_message('The item id you specified is out of bounds!') next @@ -27,7 +28,8 @@ on :command, :remove, RIGHTS_MOD do |player, command| next end - id = args[0].to_i, amount = args.length == 2 ? args[1].to_i : 1 + id = args[0].to_i + amount = args.length == 2 ? args[1].to_i : 1 if (id < 0 || id >= ItemDefinition.count) player.send_message('The item id you specified is out of bounds!') next