From 0b992256fbfb7a59ac44903c592502f9cac53397 Mon Sep 17 00:00:00 2001 From: David Gay Date: Fri, 28 May 2021 22:41:25 -0400 Subject: Fix bug caused by being too wounded to continue combat but not having `#finish_activity` return --- app/controllers/game_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/game_controller.rb b/app/controllers/game_controller.rb index dcfc3a3..aad4b31 100644 --- a/app/controllers/game_controller.rb +++ b/app/controllers/game_controller.rb @@ -132,6 +132,7 @@ class GameController < ApplicationController else current_char.stop_activity @results.push({ type: "message", body: "You have finished your work." }) + return end else current_char.update(activity_started_at: Time.now) @@ -206,6 +207,7 @@ class GameController < ApplicationController @results.push([{ type: "error", message: "You can't fight in your condition. You'll have to heal a wound." }]) char.stop_activity unless char.can_fight? + return end else @results.push({ type: "message", body: "You slew the #{mon.name}." }) -- cgit v1.2.3