summaryrefslogtreecommitdiff
path: root/app/controllers/activities_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/activities_controller.rb')
-rw-r--r--app/controllers/activities_controller.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb
index a535f99..a32ffab 100644
--- a/app/controllers/activities_controller.rb
+++ b/app/controllers/activities_controller.rb
@@ -5,7 +5,11 @@ class ActivitiesController < ApplicationController
def start
@activity = Activity.find(params[:id])
- current_char.update(activity: @activity, activity_started_at: Time.now)
- redirect_to action: :show
+ if current_char.can_do_activity?(@activity)
+ redirect_to action: :show
+ else
+ flash[:alert] = "You can't do that. Make sure you have the items and meet the requirements."
+ redirect_to character_path(current_char)
+ end
end
end