From 38fff0e2d09f2954d747baf65ab555427ba653be Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 19 May 2021 19:24:20 -0400 Subject: Hearth amenity building working! --- app/controllers/activities_controller.rb | 1 + app/controllers/game_controller.rb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'app/controllers') diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb index a32ffab..f72bc3a 100644 --- a/app/controllers/activities_controller.rb +++ b/app/controllers/activities_controller.rb @@ -6,6 +6,7 @@ class ActivitiesController < ApplicationController def start @activity = Activity.find(params[:id]) if current_char.can_do_activity?(@activity) + current_char.start_activity(@activity) redirect_to action: :show else flash[:alert] = "You can't do that. Make sure you have the items and meet the requirements." 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 -- cgit v1.2.3