summaryrefslogtreecommitdiff
path: root/app/controllers/game_controller.rb
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-05-19 19:24:20 -0400
committerDavid Gay <david@davidgay.org>2021-05-19 19:24:20 -0400
commit38fff0e2d09f2954d747baf65ab555427ba653be (patch)
treed1e9c488a910015d907e539febe8cf683af3dc88 /app/controllers/game_controller.rb
parent045867220ea68b912f74b74a1476ac08bd19dbfd (diff)
Hearth amenity building working!
Diffstat (limited to 'app/controllers/game_controller.rb')
-rw-r--r--app/controllers/game_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/game_controller.rb b/app/controllers/game_controller.rb
index 1b88cb8..d3d3ce2 100644
--- a/app/controllers/game_controller.rb
+++ b/app/controllers/game_controller.rb
@@ -44,7 +44,8 @@ class GameController < ApplicationController
end
end
when "hearth_amenity"
- bhi = BuiltHearthAmenity.find_or_initialize_by(hearth_amenity: HearthAmenity.find_by_gid(result[:gid]))
+ bhi = current_char.hearth.built_hearth_amenities
+ .find_or_initialize_by(hearth_amenity: HearthAmenity.find_by_gid(result[:gid]))
bhi.update(level: result[:level])
@results.push({ type: type, hearth_amenity: bhi.hearth_amenity })
else