From d119a7c229ff4917ad237d8b456a3322bd12789d Mon Sep 17 00:00:00 2001 From: Derek Hoffmann Date: Thu, 2 Jan 2025 22:35:18 -0500 Subject: [PATCH 1/2] [common] [arcana] Resolve potential race condition in crafting_magic_routine --- common-arcana.lic | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common-arcana.lic b/common-arcana.lic index cd7669b291..68ff11f7a3 100644 --- a/common-arcana.lic +++ b/common-arcana.lic @@ -836,14 +836,15 @@ module DRCA return if training_spells.empty? return if DRStats.mana <= settings.waggle_spells_mana_threshold - if !XMLData.prepared_spell.eql?('None') && checkcastrt == 0 + + if checkcastrt > 0 + return + elsif !XMLData.prepared_spell.eql?('None') && checkcastrt == 0 spell = XMLData.prepared_spell data = training_spells.find { |_skill, info| info['name'] == spell }.last crafting_cast_spell(data, settings) end - return if checkcastrt > 0 - needs_training = %w[Warding Utility Augmentation] needs_training.append("Sorcery") if (settings.crafting_training_spells_enable_sorcery && !Script.running?('forge')) || (settings.crafting_training_spells_enable_sorcery && settings.crafting_training_spells_enable_sorcery_forging) From 3e4e097867f3db1d90beb3b864850bcf12f40de2 Mon Sep 17 00:00:00 2001 From: Derek Hoffmann Date: Thu, 2 Jan 2025 22:46:20 -0500 Subject: [PATCH 2/2] rubocop --- common-arcana.lic | 1 - 1 file changed, 1 deletion(-) diff --git a/common-arcana.lic b/common-arcana.lic index 68ff11f7a3..85a8c0c4f2 100644 --- a/common-arcana.lic +++ b/common-arcana.lic @@ -836,7 +836,6 @@ module DRCA return if training_spells.empty? return if DRStats.mana <= settings.waggle_spells_mana_threshold - if checkcastrt > 0 return elsif !XMLData.prepared_spell.eql?('None') && checkcastrt == 0