From 6ad1800081d8bbbf9375dc9744f7f35357c19d68 Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 26 May 2021 21:43:04 -0400 Subject: Immediately stop activity if unable to fight at the end of an encounter, rather than waiting for the timer to go down again --- app/controllers/game_controller.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app') 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| -- cgit v1.2.3