From 6d56b5b7306c6f9eb4ab4cc0e33c9582de24be7c Mon Sep 17 00:00:00 2001 From: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com> Date: Mon, 4 Jul 2022 23:28:21 -0400 Subject: [PATCH] [Bug Fix] Fix Spell Bucket and Spell Global Logic Checks. (#2285) - Default to true and set to false if they fail the proper check. --- zone/client.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index 08a771143..de4875681 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -10288,7 +10288,7 @@ void Client::Fling(float value, float target_x, float target_y, float target_z, std::vector Client::GetLearnableDisciplines(uint8 min_level, uint8 max_level) { std::vector learnable_disciplines; for (uint16 spell_id = 0; spell_id < SPDAT_RECORDS; ++spell_id) { - bool learnable = false; + bool learnable = true; if (!IsValidSpell(spell_id)) { continue; } @@ -10321,12 +10321,10 @@ std::vector Client::GetLearnableDisciplines(uint8 min_level, uint8 max_leve continue; } - if (RuleB(Spells, EnableSpellGlobals) && SpellGlobalCheck(spell_id, CharacterID())) { - learnable = true; - } else if (RuleB(Spells, EnableSpellBuckets) && SpellBucketCheck(spell_id, CharacterID())) { - learnable = true; - } else { - learnable = true; + if (RuleB(Spells, EnableSpellGlobals) && !SpellGlobalCheck(spell_id, CharacterID())) { + learnable = false; + } else if (RuleB(Spells, EnableSpellBuckets) && !SpellBucketCheck(spell_id, CharacterID())) { + learnable = false; } if (learnable) { @@ -10359,7 +10357,7 @@ std::vector Client::GetMemmedSpells() { std::vector Client::GetScribeableSpells(uint8 min_level, uint8 max_level) { std::vector scribeable_spells; for (uint16 spell_id = 0; spell_id < SPDAT_RECORDS; ++spell_id) { - bool scribeable = false; + bool scribeable = true; if (!IsValidSpell(spell_id)) { continue; } @@ -10392,12 +10390,10 @@ std::vector Client::GetScribeableSpells(uint8 min_level, uint8 max_level) { continue; } - if (RuleB(Spells, EnableSpellGlobals) && SpellGlobalCheck(spell_id, CharacterID())) { - scribeable = true; - } else if (RuleB(Spells, EnableSpellBuckets) && SpellBucketCheck(spell_id, CharacterID())) { - scribeable = true; - } else { - scribeable = true; + if (RuleB(Spells, EnableSpellGlobals) && !SpellGlobalCheck(spell_id, CharacterID())) { + scribeable = false; + } else if (RuleB(Spells, EnableSpellBuckets) && !SpellBucketCheck(spell_id, CharacterID())) { + scribeable = false; } if (scribeable) {