From 1bb7b37aaaad65f8abd709207830477b98eb57b6 Mon Sep 17 00:00:00 2001 From: Major- Date: Fri, 7 Mar 2014 17:11:09 +0000 Subject: [PATCH] Fix mining. --- data/plugins/skill-mining/mining.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/plugins/skill-mining/mining.rb b/data/plugins/skill-mining/mining.rb index a9da8d38..4a7bb8f3 100644 --- a/data/plugins/skill-mining/mining.rb +++ b/data/plugins/skill-mining/mining.rb @@ -22,7 +22,7 @@ class MiningAction < DistancedAction def find_pickaxe PICKAXE_IDS.each do |id| weapon = mob.equipment.get(EquipmentConstants::WEAPON) - if weapon.id == id + if weapon != nil && weapon.id == id return PICKAXES[id] end @@ -73,7 +73,7 @@ class MiningAction < DistancedAction if mob.inventory.add(ore.id) ore_def = ItemDefinition.lookup(@ore.id) # TODO: split off into some method - name = ore_def.name.sub(/ ore$/, "").downcase + name = ore_def.name.sub(/ ore$/, '').downcase mob.send_message("You manage to mine some #{name}.") skills.add_experience(MINING_SKILL_ID, ore.exp) @@ -124,11 +124,11 @@ class ProspectingAction < DistancedAction if not @started @started = true - mob.send_message("You examine the rock for ores...") + mob.send_message('You examine the rock for ores...') mob.turn_to(@position) else ore_def = ItemDefinition.lookup(@ore.id) - name = ore_def.name.sub(/ ore$/, "").downcase + name = ore_def.name.sub(/ ore$/, '').downcase mob.send_message("This rock contains #{name}.")