From 7433ac3221f9d784b8797afc4c94df1846becbd1 Mon Sep 17 00:00:00 2001 From: David Gay Date: Mon, 7 Jun 2021 16:05:34 -0400 Subject: Don't say character earned the Sentinel title if they already had it --- app/models/monster_spawn_combat.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/models/monster_spawn_combat.rb b/app/models/monster_spawn_combat.rb index 08fe0f2..8dbd8e8 100644 --- a/app/models/monster_spawn_combat.rb +++ b/app/models/monster_spawn_combat.rb @@ -84,8 +84,9 @@ class MonsterSpawnCombat < ApplicationRecord character_damage[character] = MonsterSpawnCombat.where(monster_spawn: monster_spawn, character: character).sum(:hp_lost) end title_recipient = character_damage.max_by { |_, v| v }[0] - title_recipient.award_title("sentinel") - message_body_parts[title_recipient.id].push("You earned the Sentinel title!") + if title_recipient.award_title("sentinel") + message_body_parts[title_recipient.id].push("You earned the Sentinel title!") + end message_body_parts.each do |character_id, body_parts| if body_parts.any? -- cgit v1.2.3