summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-05-26 21:43:04 -0400
committerDavid Gay <david@davidgay.org>2021-05-26 21:43:04 -0400
commit6ad1800081d8bbbf9375dc9744f7f35357c19d68 (patch)
tree17245bc09383f7a1a7bcda5d3e337a1b86566e32 /app
parent7247a6fb0b3b374f3dac651bd2b133bcb5303534 (diff)
Immediately stop activity if unable to fight at the end of an encounter, rather than waiting for the timer to go down again
Diffstat (limited to 'app')
-rw-r--r--app/controllers/game_controller.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/controllers/game_controller.rb b/app/controllers/game_controller.rb
index 4f1ca0f..40d8991 100644
--- a/app/controllers/game_controller.rb
+++ b/app/controllers/game_controller.rb
@@ -173,6 +173,7 @@ class GameController < ApplicationController
@results.push({ type: "message", body: "You were defeated! You retreat, wounded." })
char.wounds += 1
char.save!
+ char.stop_activity unless char.can_fight?
else
@results.push({ type: "message", body: "You slew the #{mon.name}." })
mon.whatnot[:awards]&.each do |award_data|