From f17ec36cdecc908b7b51a3b161a1136462ba6348 Mon Sep 17 00:00:00 2001 From: SaW Date: Mon, 12 May 2025 23:46:05 +0200 Subject: [PATCH] =?UTF-8?q?Revert=20"Introduction=20of=20the=20SafeLearn(s?= =?UTF-8?q?pellId)=20lambda=20that=20checks=20if=20the=20bot=20=E2=80=A6"?= =?UTF-8?q?=20(#1289)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6d24db6999960bef57877abb893c4be63992c836. --- src/factory/PlayerbotFactory.cpp | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/src/factory/PlayerbotFactory.cpp b/src/factory/PlayerbotFactory.cpp index 64bedb4d..2c55c4ef 100644 --- a/src/factory/PlayerbotFactory.cpp +++ b/src/factory/PlayerbotFactory.cpp @@ -2200,33 +2200,15 @@ void PlayerbotFactory::InitSkills() //uint32 maxValue = level * 5; //not used, line marked for removal. bot->UpdateSkillsForLevel(); - auto SafeLearn = [this](uint32 spellId) - { - if (!bot->HasSpell(spellId)) - bot->learnSpell(spellId, false, true); // Avoid duplicate attempts in DB - }; - - // Define Riding skill according to level - if (bot->GetLevel() >= 70) - bot->SetSkill(SKILL_RIDING, 300, 300, 300); - else if (bot->GetLevel() >= 60) - bot->SetSkill(SKILL_RIDING, 225, 225, 225); - else if (bot->GetLevel() >= 40) - bot->SetSkill(SKILL_RIDING, 150, 150, 150); - else if (bot->GetLevel() >= 20) - bot->SetSkill(SKILL_RIDING, 75, 75, 75); - else - bot->SetSkill(SKILL_RIDING, 0, 0, 0); - - // Safe learning of mount spells + bot->SetSkill(SKILL_RIDING, 0, 0, 0); if (bot->GetLevel() >= sPlayerbotAIConfig->useGroundMountAtMinLevel) - SafeLearn(33388); // Apprentice + bot->learnSpell(33388); if (bot->GetLevel() >= sPlayerbotAIConfig->useFastGroundMountAtMinLevel) - SafeLearn(33391); // Journeyman + bot->learnSpell(33391); if (bot->GetLevel() >= sPlayerbotAIConfig->useFlyMountAtMinLevel) - SafeLearn(34090); // Expert + bot->learnSpell(34090); if (bot->GetLevel() >= sPlayerbotAIConfig->useFastFlyMountAtMinLevel) - SafeLearn(34091); // Artisan + bot->learnSpell(34091); uint32 skillLevel = bot->GetLevel() < 40 ? 0 : 1; uint32 dualWieldLevel = bot->GetLevel() < 20 ? 0 : 1;