summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-06-05 22:10:05 -0400
committerDavid Gay <david@davidgay.org>2021-06-05 22:10:05 -0400
commitf5a965c538a108be275f0de9f1dc7abc8eb7ffbb (patch)
treeadc7077e075ce2f76769fdcb5ef951d0fcd84622
parentfca3ea73b54b0881c3b2c2d7868fbd4d68b163fe (diff)
Fix item gathering and crafting not giving XP
-rw-r--r--CHANGELOG.md5
-rw-r--r--app/lib/activity_processor.rb6
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