From f5a965c538a108be275f0de9f1dc7abc8eb7ffbb Mon Sep 17 00:00:00 2001 From: David Gay Date: Sat, 5 Jun 2021 22:10:05 -0400 Subject: Fix item gathering and crafting not giving XP --- CHANGELOG.md | 5 +++++ app/lib/activity_processor.rb | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fd1cf8..37ced58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog All notable changes to this project will be documented in this file. +## [0.1.7.1] - 2021-06-05 + +### Fixed +- Item gathering and crafting was not giving XP. + ## [0.1.7] - 2021-06-05 ### Activities diff --git a/app/lib/activity_processor.rb b/app/lib/activity_processor.rb index d8004f6..eaad611 100644 --- a/app/lib/activity_processor.rb +++ b/app/lib/activity_processor.rb @@ -62,7 +62,7 @@ class ActivityProcessor end end when "item" - handle_item_result(result) + handle_item_result(result, with_xp: true) when "hearth_amenity" bhi = @character.hearth.built_hearth_amenities .find_or_initialize_by(hearth_amenity: HearthAmenity.find_by_gid(result[:gid])) @@ -161,7 +161,7 @@ class ActivityProcessor @results.push({ type: "xp", skill: skill, xp: amount }) end - def handle_item_result(data) + def handle_item_result(data, with_xp: false) return if rand > (data[:chance] || 1) if data[:table] @@ -187,7 +187,7 @@ class ActivityProcessor min_quantity = data[:min_quantity] || data[:quantity] || 1 max_quantity = data[:max_quantity] || data[:quantity] || 1 quantity = rand(min_quantity..max_quantity) - give_item(data, quantity) + give_item(data, quantity, with_xp: with_xp) end end -- cgit v1.2.3