From bce9b7729ec148d0b728602309fea6787802468b Mon Sep 17 00:00:00 2001 From: David Gay Date: Sun, 6 Jun 2021 12:36:43 -0400 Subject: Fix bug when awarding XP from things like opening rusted lockbox --- CHANGELOG.md | 3 +++ app/lib/activity_processor.rb | 3 ++- data/monsters.yml | 12 ++++++------ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c031cef..ffb0af2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,9 @@ All notable changes to this project will be documented in this file. is returned from the server, the retries will cease after 3 failures to avoid flooding our new error monitoring. I will monitor and potentially improve this system (and the finish activity code) as time goes forward, but this should be sufficient for now. + +### Fixed +- Unlocking rusted lockbox failed to complete due to bug introduced by refactoring in 0.1.7. ## [0.1.7.2] - 2021-06-05 diff --git a/app/lib/activity_processor.rb b/app/lib/activity_processor.rb index 6d2cd90..73f296d 100644 --- a/app/lib/activity_processor.rb +++ b/app/lib/activity_processor.rb @@ -37,6 +37,7 @@ class ActivityProcessor type = result[:type] case type when "xp" + puts "Result: #{result}" handle_xp_result(result) when "monster" raise TooManyWoundsError unless @character.can_fight? @@ -155,7 +156,7 @@ class ActivityProcessor end def handle_xp_result(data) - skill = Skill.find_by_gid(data[:skill]) + skill = Skill.find_by_gid(data[:gid]) amount = data[:base] @character.add_skill_xp(skill, amount) @results.push({ type: "xp", skill: skill, xp: amount }) diff --git a/data/monsters.yml b/data/monsters.yml index 849c38c..4a8dc40 100644 --- a/data/monsters.yml +++ b/data/monsters.yml @@ -20,7 +20,7 @@ pit_leech: base: 1 awards: - type: "xp" - skill: "beastslay" + gid: "beastslay" base: 4 - type: "item" chance: 1 @@ -53,7 +53,7 @@ stalk_beast: base: 1 awards: - type: "xp" - skill: "beastslay" + gid: "beastslay" base: 9 - type: "item" chance: 1 @@ -88,7 +88,7 @@ grinpad: base: 1 awards: - type: "xp" - skill: "beastslay" + gid: "beastslay" base: 13 - type: "item" chance: 1 @@ -128,7 +128,7 @@ lesser_trodgeathomp: base: 3 awards: - type: "xp" - skill: "beastslay" + gid: "beastslay" base: 20 - type: "title" gid: "retributor" @@ -166,7 +166,7 @@ bollyrot: base: 2 awards: - type: "xp" - skill: "beastslay" + gid: "beastslay" base: 20 - type: "item" chance: 1 @@ -201,7 +201,7 @@ crypt_writhe: base: 4 awards: - type: "xp" - skill: "beastslay" + gid: "beastslay" base: 28 - type: "item" chance: 0.05 -- cgit v1.2.3