summaryrefslogtreecommitdiff
path: root/app/lib
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:12:32 -0400
commit978587487352cbc95f8ceee70ddf69b2fd9a6da3 (patch)
treebe304134b6adab332e0c903ee7c011aeae19467b /app/lib
parentfca3ea73b54b0881c3b2c2d7868fbd4d68b163fe (diff)
Fix item gathering and crafting not giving XP
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/activity_processor.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/lib/activity_processor.rb b/app/lib/activity_processor.rb
index d8004f6..6d2cd90 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]
@@ -175,7 +175,7 @@ class ActivityProcessor
score = table_entry[:score]
if table_roll >= score
- give_item(table_entry, quantity)
+ give_item(table_entry, quantity, with_xp: with_xp)
table_entry[:titles]&.each do |title_data|
handle_title_result(title_data)
@@ -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