summaryrefslogtreecommitdiff
path: root/app/controllers/game_controller.rb
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-05-28 22:41:25 -0400
committerDavid Gay <david@davidgay.org>2021-05-28 22:41:25 -0400
commit0b992256fbfb7a59ac44903c592502f9cac53397 (patch)
tree1b43734de184f438e998736abc830e38032a4fe9 /app/controllers/game_controller.rb
parentcc750d4ff11dfa690161270726280c0ba7fccde7 (diff)
Fix bug caused by being too wounded to continue combat but not having `#finish_activity` return
Diffstat (limited to 'app/controllers/game_controller.rb')
-rw-r--r--app/controllers/game_controller.rb2
1 files changed, 2 insertions, 0 deletions
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}." })