diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/character.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/models/character.rb b/app/models/character.rb index 040c89b..970ede1 100644 --- a/app/models/character.rb +++ b/app/models/character.rb @@ -138,8 +138,16 @@ class Character < ApplicationRecord true end - def start_activity(activity) - self.update(activity: activity, activity_started_at: Time.now) if self.can_do_activity?(activity) + def start_activity(activity, queued_actions: nil) + if self.can_do_activity?(activity) + self.update(activity: activity, activity_started_at: Time.now, queued_actions: queued_actions) + else + false + end + end + + def stop_activity + self.update(activity: nil, activity_started_at: nil, queued_actions: nil) end def equipment_stats |