From 14a7cb5ac51667f51782f70eedf855b035ba1040 Mon Sep 17 00:00:00 2001 From: Major- Date: Mon, 24 Feb 2014 08:06:02 +0000 Subject: [PATCH] Remove minor repetition in potions.rb. --- data/plugins/consumables/potions.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/plugins/consumables/potions.rb b/data/plugins/consumables/potions.rb index d12a866e..55ff326d 100644 --- a/data/plugins/consumables/potions.rb +++ b/data/plugins/consumables/potions.rb @@ -13,12 +13,12 @@ class Potion < Consumable end def consume(player) - index = @doses.find_index(id) + index = @doses.find_index(id) + 1 - unless index + 1 == @doses.length - player.inventory.add(@doses[index + 1]) + unless index == @doses.length + player.inventory.add(@doses[index]) player.send_message("You drink some of your #{name} potion.", true) - player.send_message("You have #{@doses.length - index - 1} dose#{"s" unless index == 2} of potion left.", true) + player.send_message("You have #{@doses.length - index} dose#{"s" unless index == 3} of potion left.", true) else player.send_message('You drink the last of your potion.') player.inventory.add(EMPTY_VIAL_ID)